If cronErros is empty json_decode will return NULL

Fixes #9867

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-06-19 16:26:06 +02:00
parent c3aea9cdf6
commit 3cbe40ffac
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 11 additions and 1 deletions

View File

@ -513,6 +513,16 @@ Raw output
];
}
protected function getCronErrors() {
$errors = json_decode($this->config->getAppValue('core', 'cronErrors', ''), true);
if (is_array($errors)) {
return $errors;
}
return [];
}
/**
* @return DataResponse
*/
@ -527,7 +537,7 @@ Raw output
'hasWorkingFileLocking' => $this->hasWorkingFileLocking(),
'suggestedOverwriteCliURL' => $this->getSuggestedOverwriteCliURL(),
'cronInfo' => $this->getLastCronInfo(),
'cronErrors' => json_decode($this->config->getAppValue('core', 'cronErrors', ''), true),
'cronErrors' => $this->getCronErrors(),
'serverHasInternetConnection' => $this->isInternetConnectionWorking(),
'isMemcacheConfigured' => $this->isMemcacheConfigured(),
'memcacheDocs' => $this->urlGenerator->linkToDocs('admin-performance'),