Skip to content

Commit

Permalink
null check
Browse files Browse the repository at this point in the history
  • Loading branch information
tischsoic committed Feb 22, 2024
1 parent 46e94ab commit 4de0946
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/Server/Input/Parser/FilterParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public function parse(array $data, ParsingDispatcher $parsingDispatcher): Filter
{
$filter = new Filter();
if (array_key_exists('criteria', $data) && is_array($data['criteria'])) {
$filter->andWithCriterion($this->processCriteriaArray($data['criteria'], $parsingDispatcher));
$criteria = $this->processCriteriaArray($data['criteria'], $parsingDispatcher);

if ($criteria !== null) {
$filter->andWithCriterion($criteria);

Check failure on line 37 in src/lib/Server/Input/Parser/FilterParser.php

View workflow job for this annotation

GitHub Actions / Unit & integration tests (7.4)

Parameter #1 $criterion of method Ibexa\Contracts\Core\Repository\Values\Filter\Filter::andWithCriterion() expects Ibexa\Contracts\Core\Repository\Values\Filter\FilteringCriterion, Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion given.

Check failure on line 37 in src/lib/Server/Input/Parser/FilterParser.php

View workflow job for this annotation

GitHub Actions / Unit & integration tests (8.0)

Parameter #1 $criterion of method Ibexa\Contracts\Core\Repository\Values\Filter\Filter::andWithCriterion() expects Ibexa\Contracts\Core\Repository\Values\Filter\FilteringCriterion, Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion given.

Check failure on line 37 in src/lib/Server/Input/Parser/FilterParser.php

View workflow job for this annotation

GitHub Actions / Unit & integration tests (8.2)

Parameter #1 $criterion of method Ibexa\Contracts\Core\Repository\Values\Filter\Filter::andWithCriterion() expects Ibexa\Contracts\Core\Repository\Values\Filter\FilteringCriterion, Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion given.
}
}

// limit
Expand Down

0 comments on commit 4de0946

Please sign in to comment.