Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/survey_server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-08-17 11:38:59 +0300
committerBjoern Schiessle <bjoern@schiessle.org>2016-08-17 11:38:59 +0300
commit5be7226ff59e2cda735201c2abcc6bc807b24e2a (patch)
treed1dad470cf5105fcd80ff820ef17a9e993ca418e
parentb3345cd7cde97b6f45593ee157472c4b32eb1581 (diff)
return always a empty array if no data available
-rw-r--r--lib/Service/StatisticService.php7
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;
}
}