Merge pull request #11973 from nextcloud/bug/accessibility/get_js_without_uid
If there is no UID do not explode accessibility javascript
This commit is contained in:
commit
31d1179c41
|
@ -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) . ',
|
||||
|
||||
};
|
||||
})();';
|
||||
|
|
Loading…
Reference in New Issue