diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/InitialStateService.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/InitialStateService.php b/lib/private/InitialStateService.php index 1d997e4133a..c10442a5267 100644 --- a/lib/private/InitialStateService.php +++ b/lib/private/InitialStateService.php @@ -64,7 +64,11 @@ class InitialStateService implements IInitialStateService { if (!isset($this->states[$appName])) { $this->states[$appName] = []; } - $this->states[$appName][$key] = json_encode($data); + try { + $this->states[$appName][$key] = json_encode($data, JSON_THROW_ON_ERROR); + } catch (\JsonException $e) { + $this->logger->error('Invalid '. $key . ' data provided to provideInitialState by ' . $appName, ['exception' => $e]); + } return; } |