summaryrefslogtreecommitdiffstats
path: root/apps/accessibility/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/accessibility/lib')
-rw-r--r--apps/accessibility/lib/Controller/AccessibilityController.php10
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) . ',
};
})();';