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:
Roeland Jago Douma 2018-10-23 10:18:45 +02:00 committed by GitHub
commit 31d1179c41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) . ',
};
})();';