summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-04-23 11:50:30 +0200
committerJoas Schilling <coding@schilljs.com>2018-04-23 11:50:30 +0200
commit446efa46250ae92ee038aaa76967aee21450a082 (patch)
tree870b265055d806859f08b355e9601992935dd1ee /lib
parent3ff041f86d936524674d2def257ddc4b15a2c105 (diff)
downloadnextcloud-server-446efa46250ae92ee038aaa76967aee21450a082.tar.gz
nextcloud-server-446efa46250ae92ee038aaa76967aee21450a082.zip
Only query last comment info, when there is one
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Comments/Manager.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php
index 9393cce334d..d96c22aad51 100644
--- a/lib/private/Comments/Manager.php
+++ b/lib/private/Comments/Manager.php
@@ -407,11 +407,11 @@ class Manager implements ICommentsManager {
$query->setMaxResults($limit);
}
- $lastKnownComment = $this->getLastKnownComment(
+ $lastKnownComment = $lastKnownCommentId > 0 ? $this->getLastKnownComment(
$objectType,
$objectId,
$lastKnownCommentId
- );
+ ) : null;
if ($lastKnownComment instanceof IComment) {
$lastKnownCommentDateTime = $lastKnownComment->getCreationDateTime();
if ($sortDirection === 'desc') {