OSDN Git Service

Controller::API::Timeline: fix typo
authorhylom <hylom@users.sourceforge.jp>
Fri, 5 Apr 2019 09:54:36 +0000 (18:54 +0900)
committerhylom <hylom@users.sourceforge.jp>
Fri, 5 Apr 2019 09:55:00 +0000 (18:55 +0900)
src/newslash_web/lib/Newslash/Web/Controller/API/Timeline.pm

index cec598f..700dddb 100644 (file)
@@ -63,6 +63,8 @@ sub _get_primary_topic_icon_url {
 sub _moderation_points_to_score {
     my ($c, $item) = @_;
     my $point = $item->{points};
+    return if !defined $point;
+
     my $heatmap = _get_heatmap($c);
     if (!$heatmap) {
         return;
@@ -72,7 +74,7 @@ sub _moderation_points_to_score {
     return -50 if !$color;
 
     my @scores = values %$color;
-    return @scores[0] + 1;
+    return $scores[0] + 1;
 }
 
 sub _score_to_heatmap_color {