diff --git a/lib/Pear/LocalLoop/Controller/Api/Stats.pm b/lib/Pear/LocalLoop/Controller/Api/Stats.pm index 2f698cc..db46fd0 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Stats.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Stats.pm @@ -133,7 +133,7 @@ sub post_customer { } my @cat_lists = map { { category => $_, value => $cat_total_list{$_}, - icon => $c->schema->resultset('Category')->as_hash_name_icon->{$_} } } sort keys %cat_total_list; + icon => $c->schema->resultset('Category')->as_hash_name_icon->{$_} || 'question'} } sort keys %cat_total_list; $data->{cat_list} = [ sort { $b->{value} <=> $a->{value} } @cat_lists ]; my $purchase_no_essential_rs = $purchase_rs->search({