Skip to content

Commit

Permalink
Check that suggestion is not null before setting it to the adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
pspanja committed Oct 6, 2022
1 parent 7d9f2e4 commit a7dd94f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Core/Pagination/Pagerfanta/BaseAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private function setExtraInfo(SearchResult $searchResult): void
$this->nbResults = $searchResult->totalCount;
$this->suggestion = new Suggestion([]);

if ($searchResult instanceof ExtraSearchResult) {
if ($searchResult instanceof ExtraSearchResult && $searchResult->suggestion instanceof Suggestion) {
$this->suggestion = $searchResult->suggestion;
}

Expand Down

0 comments on commit a7dd94f

Please sign in to comment.