diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-10-22 11:26:21 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-10-22 11:26:21 +0200 |
commit | 3ac15a45ea7582b8ede19a7fb0517c25408901e0 (patch) | |
tree | 600cde1a94442aafd36eb7143eb9eff1943161e0 /apps/accessibility/lib | |
parent | f7538fcc82e1341abac9113131510c50395f34b5 (diff) | |
download | nextcloud-server-3ac15a45ea7582b8ede19a7fb0517c25408901e0.tar.gz nextcloud-server-3ac15a45ea7582b8ede19a7fb0517c25408901e0.zip |
If there is no UID do not explode accessibility javascript
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/accessibility/lib')
-rw-r--r-- | apps/accessibility/lib/Controller/AccessibilityController.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/accessibility/lib/Controller/AccessibilityController.php b/apps/accessibility/lib/Controller/AccessibilityController.php index cdc9e004404..a8fba556acb 100644 --- a/apps/accessibility/lib/Controller/AccessibilityController.php +++ b/apps/accessibility/lib/Controller/AccessibilityController.php @@ -192,9 +192,17 @@ class AccessibilityController extends Controller { * @return DataDownloadResponse */ public function getJavascript(): DataDownloadResponse { + $user = $this->userSession->getUser(); + + if ($user === null) { + $theme = false; + } else { + $theme = $this->config->getUserValue($user->getUID(), $this->appName, 'theme', false); + } + $responseJS = '(function() { OCA.Accessibility = { - theme: ' . json_encode($this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false)) . ', + theme: ' . json_encode($theme) . ', }; })();'; |