diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@smile.fr> | 2015-10-06 20:51:40 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@smile.fr> | 2015-10-06 20:51:40 +0200 |
commit | ce782c84b85f23c6c6a47cd044694f48377e8416 (patch) | |
tree | 3d861d163d7b799a9d1b39703db5c3b278dbab39 /src/Wallabag/CoreBundle/Helper | |
parent | 3123b3c0c8d6a67d85973e5b17a5952b6931c54d (diff) | |
download | wallabag-ce782c84b85f23c6c6a47cd044694f48377e8416.tar.gz wallabag-ce782c84b85f23c6c6a47cd044694f48377e8416.tar.zst wallabag-ce782c84b85f23c6c6a47cd044694f48377e8416.zip |
fix bug on detect active theme
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper')
-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; |