summaryrefslogtreecommitdiffstats
path: root/apps/theming/lib/Controller
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2022-12-08 09:46:59 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2022-12-08 17:52:50 +0100
commit1acd42e10ce13d253516efb722f7d05e74fa46e9 (patch)
treefa04592316f60f454794d761567e25038fc80ce0 /apps/theming/lib/Controller
parentfabcd68a5e2c4909dc58d35e756acb0675e61311 (diff)
downloadnextcloud-server-1acd42e10ce13d253516efb722f7d05e74fa46e9.tar.gz
nextcloud-server-1acd42e10ce13d253516efb722f7d05e74fa46e9.zip
Invert header if primary is bright and background disabled
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/theming/lib/Controller')
-rw-r--r--apps/theming/lib/Controller/UserThemeController.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/theming/lib/Controller/UserThemeController.php b/apps/theming/lib/Controller/UserThemeController.php
index a227e72d998..6a58366c4f6 100644
--- a/apps/theming/lib/Controller/UserThemeController.php
+++ b/apps/theming/lib/Controller/UserThemeController.php
@@ -50,16 +50,14 @@ use OCP\PreConditionNotMetException;
class UserThemeController extends OCSController {
- protected string $userId;
+ protected ?string $userId = null;
+
private IConfig $config;
private IUserSession $userSession;
private ThemesService $themesService;
private ThemingDefaults $themingDefaults;
private BackgroundService $backgroundService;
- /**
- * Config constructor.
- */
public function __construct(string $appName,
IRequest $request,
IConfig $config,
@@ -73,7 +71,11 @@ class UserThemeController extends OCSController {
$this->themesService = $themesService;
$this->themingDefaults = $themingDefaults;
$this->backgroundService = $backgroundService;
- $this->userId = $userSession->getUser()->getUID();
+
+ $user = $userSession->getUser();
+ if ($user !== null) {
+ $this->userId = $user->getUID();
+ }
}
/**