X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/4360da03d414cc926dde3d79e22e6e35f85838e1..refs/pull/3113/head:/app/Actions/CommentRepo.php diff --git a/app/Actions/CommentRepo.php b/app/Actions/CommentRepo.php index 8121dfc5c..8061c4542 100644 --- a/app/Actions/CommentRepo.php +++ b/app/Actions/CommentRepo.php @@ -90,8 +90,9 @@ class CommentRepo */ protected function getNextLocalId(Entity $entity): int { - $comments = $entity->comments(false)->orderBy('local_id', 'desc')->first(); + /** @var Comment $comment */ + $comment = $entity->comments(false)->orderBy('local_id', 'desc')->first(); - return ($comments->local_id ?? 0) + 1; + return ($comment->local_id ?? 0) + 1; } }