]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php
fix bug on detect active theme
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Helper / DetectActiveTheme.php
index 679186c08415f3b9cd54c35edeafe1ea68ec5490..054a375227c0345c7712c660c2682e81161d050a 100644 (file)
@@ -42,7 +42,13 @@ class DetectActiveTheme implements DeviceDetectionInterface
      */
     public function getType()
     {
-        $user = $this->securityContext->getToken()->getUser();
+        $token = $this->securityContext->getToken();
+
+        if (is_null($token)) {
+            return $this->defaultTheme;
+        }
+
+        $user = $token->getUser();
 
         if (!$user instanceof User) {
             return $this->defaultTheme;