From 8bdc03eb5cfa347121b30d55286bb58cff771af1 Mon Sep 17 00:00:00 2001 From: Finn Date: Mon, 18 Jun 2018 12:10:08 +0100 Subject: [PATCH] added default --- 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 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({