Skip to content

Commit

Permalink
Check if array is not null before checking for the existence of the key
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed Aug 29, 2024
1 parent 81b6989 commit 416fac8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/Controller/ListViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function mainAction(): void

// extract collection(s) from collection parameter
$collections = [];
if (array_key_exists('collection', $this->searchParams)) {
if (is_array($this->searchParams) && array_key_exists('collection', $this->searchParams)) {
foreach(explode(',', $this->searchParams['collection']) as $collectionEntry) {
$collections[] = $this->collectionRepository->findByUid((int) $collectionEntry);
}
Expand Down

0 comments on commit 416fac8

Please sign in to comment.