From e817dc29b114f85bf730af9c27f13dbc95d43bf1 Mon Sep 17 00:00:00 2001 From: Finn Date: Wed, 21 Mar 2018 17:58:50 +0000 Subject: [PATCH] fixed display error --- lib/Pear/LocalLoop/Controller/Api/Stats.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Pear/LocalLoop/Controller/Api/Stats.pm b/lib/Pear/LocalLoop/Controller/Api/Stats.pm index cd348c3..711de88 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Stats.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Stats.pm @@ -92,7 +92,7 @@ sub post_customer { ); my @all_weeks = $week_transaction_rs->all; - my $first = $all_weeks[0]->get_column('count') || 0; + my $first = defined $all_weeks[0] ? $all_weeks[0]->get_column('count') || 0 : 0; my $second = defined $all_weeks[1] ? $all_weeks[1]->get_column('count') || 0 : 0; my $max = max( map { $_->get_column('count') } @all_weeks ); my $sum = sum( map { $_->get_column('count') } @all_weeks );