]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fix the way to check for an existing entry
authorJeremy Benoist <jeremy.benoist@gmail.com>
Wed, 30 Dec 2015 11:19:15 +0000 (12:19 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Sat, 2 Jan 2016 22:27:41 +0000 (23:27 +0100)
Instead of requiring more than 1 entry (> 1) we have to check for at least one entry (> 0)

src/Wallabag/CoreBundle/Repository/EntryRepository.php

index b8e22eb833a4bea43150eb2c660cac900a4207ff..c6763a40caa26d81febc8083bb4c4c267f94acf3 100644 (file)
@@ -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;