From b4b592a0c0ee356e81775baf8f9976288d7b686c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 30 Dec 2015 12:19:15 +0100 Subject: [PATCH] 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) --- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.41.0