]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Returned 0 instead of returning empty array for Twig Extension 2266/head
authorNicolas Lœuillet <nicolas@loeuillet.org>
Mon, 5 Sep 2016 12:17:44 +0000 (14:17 +0200)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Mon, 5 Sep 2016 12:17:44 +0000 (14:17 +0200)
src/Wallabag/CoreBundle/Twig/WallabagExtension.php

index 59eb57ec5fd133dff031f99bcf1b9f2958760b93..3780b13e7db5884abf3b9e156dff8db0e0b8c397 100644 (file)
@@ -54,7 +54,7 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa
         $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
 
         if (null === $user || !is_object($user)) {
-            return [];
+            return 0;
         }
 
         switch ($type) {
@@ -101,7 +101,7 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa
         $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
 
         if (null === $user || !is_object($user)) {
-            return [];
+            return 0;
         }
 
         $qb = $this->tagRepository->findAllTags($user->getId());