diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2016-08-17 11:38:59 +0300 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2016-08-17 11:38:59 +0300 |
commit | 5be7226ff59e2cda735201c2abcc6bc807b24e2a (patch) | |
tree | d1dad470cf5105fcd80ff820ef17a9e993ca418e | |
parent | b3345cd7cde97b6f45593ee157472c4b32eb1581 (diff) |
return always a empty array if no data available
-rw-r--r-- | lib/Service/StatisticService.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Service/StatisticService.php b/lib/Service/StatisticService.php index a48a5fd..95934f1 100644 --- a/lib/Service/StatisticService.php +++ b/lib/Service/StatisticService.php @@ -98,7 +98,12 @@ class StatisticService { */ public function get() { $data = $this->config->getAppValue('survey_server', 'evaluated_statistics', '[]'); - return json_decode($data, true); + $result = json_decode($data, true); + if($result === null) { + return []; + } + + return $result; } } |