From: Jeremy Benoist Date: Wed, 30 Dec 2015 11:19:15 +0000 (+0100) Subject: Fix the way to check for an existing entry X-Git-Tag: 2.0.0-alpha.1^2~9 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=b4b592a0c0ee356e81775baf8f9976288d7b686c;p=github%2Fwallabag%2Fwallabag.git Fix the way to check for an existing entry Instead of requiring more than 1 entry (> 1) we have to check for at least one entry (> 0) --- diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index b8e22eb8..c6763a40 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -242,8 +242,8 @@ class EntryRepository extends EntityRepository ->getQuery() ->getResult(); - if (count($res) > 1) { - return next($res); + if (count($res)) { + return current($res); } return false;