mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(comments): Don't throw type error when no itemType or itemId is given
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
d659cbcd0e
commit
d332091105
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue