From d9311bec087c2858bae3110253f36b565cdafdfd 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 46fec87c777..faecc1f7a47 100644 --- a/apps/comments/lib/Collaboration/CommentersSorter.php +++ b/apps/comments/lib/Collaboration/CommentersSorter.php @@ -26,6 +26,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;