summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-04-23 16:43:09 +0200
committerGitHub <noreply@github.com>2018-04-23 16:43:09 +0200
commit9b150001ffe8eedeb04d64e870a618f1c0680e1f (patch)
tree9d988f9784c47b2df824a46faef0734fe281d695 /lib
parent351255b216a631f39c2a6816e34a28d144869bce (diff)
parent446efa46250ae92ee038aaa76967aee21450a082 (diff)
downloadnextcloud-server-9b150001ffe8eedeb04d64e870a618f1c0680e1f.tar.gz
nextcloud-server-9b150001ffe8eedeb04d64e870a618f1c0680e1f.zip
Merge pull request #9272 from nextcloud/bugfix/noid/save-a-query-help-saving-the-world
Only query last comment info, when there is one
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') {