From d332091105929a1e9eb2de8ad7ab0b9688253a69 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 9 Oct 2025 11:08:54 +0200 Subject: [PATCH] fix(comments): Don't throw type error when no itemType or itemId is given Signed-off-by: Joas Schilling --- apps/comments/lib/Collaboration/CommentersSorter.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/comments/lib/Collaboration/CommentersSorter.php b/apps/comments/lib/Collaboration/CommentersSorter.php index baa27155573..eb0ea469cfd 100644 --- a/apps/comments/lib/Collaboration/CommentersSorter.php +++ b/apps/comments/lib/Collaboration/CommentersSorter.php @@ -27,6 +27,10 @@ class CommentersSorter implements ISorter { * @param array $context */ public function sort(array &$sortArray, array $context): void { + if (!isset($context['itemType'], $context['itemId'])) { + return; + } + $commenters = $this->retrieveCommentsInformation($context['itemType'], $context['itemId']); if (count($commenters) === 0) { return;