From: Nicolas LÅ“uillet Date: Mon, 5 Sep 2016 12:17:44 +0000 (+0200) Subject: Returned 0 instead of returning empty array for Twig Extension X-Git-Tag: 2.1.0~42^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=5173fd1c3d05d1fadfbdd4db862cd744209e13ac;p=github%2Fwallabag%2Fwallabag.git Returned 0 instead of returning empty array for Twig Extension --- diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php index 59eb57ec..3780b13e 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php @@ -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());