OSDN Git Service

fix some warning
authorhylom <hylom@users.sourceforge.jp>
Mon, 22 Apr 2019 10:30:35 +0000 (19:30 +0900)
committerhylom <hylom@users.sourceforge.jp>
Mon, 22 Apr 2019 10:30:35 +0000 (19:30 +0900)
src/newslash_web/lib/Newslash/Plugin/NewslashHelpers.pm
src/newslash_web/lib/Newslash/Web/Controller/API/Timeline.pm

index fce0098..be93931 100644 (file)
@@ -236,7 +236,7 @@ sub _extract_description {
 
     # split to paragraphs
     my @paragraphs = split(/([。.])/, $text);
-    my $result;
+    my $result = "";
     my $length = 0;
 
     while (@paragraphs) {
index 700dddb..e87122a 100644 (file)
@@ -90,7 +90,7 @@ sub _score_to_heatmap_color {
         my $color = $last_color = $k[0];
         my $threshold = $i->{$color};
 
-        if ($item->{popularity} > $threshold) {
+        if (defined $item->{popularity} && $item->{popularity} > $threshold) {
             return $color;
         }
     }