diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php b/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php index 679186c0..054a3752 100644 --- a/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php +++ b/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php | |||
@@ -42,7 +42,13 @@ class DetectActiveTheme implements DeviceDetectionInterface | |||
42 | */ | 42 | */ |
43 | public function getType() | 43 | public function getType() |
44 | { | 44 | { |
45 | $user = $this->securityContext->getToken()->getUser(); | 45 | $token = $this->securityContext->getToken(); |
46 | |||
47 | if (is_null($token)) { | ||
48 | return $this->defaultTheme; | ||
49 | } | ||
50 | |||
51 | $user = $token->getUser(); | ||
46 | 52 | ||
47 | if (!$user instanceof User) { | 53 | if (!$user instanceof User) { |
48 | return $this->defaultTheme; | 54 | return $this->defaultTheme; |