Skip to content

Commit a7dd94f

Browse files
committed
Check that suggestion is not null before setting it to the adapter
1 parent 7d9f2e4 commit a7dd94f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Core/Pagination/Pagerfanta/BaseAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private function setExtraInfo(SearchResult $searchResult): void
127127
$this->nbResults = $searchResult->totalCount;
128128
$this->suggestion = new Suggestion([]);
129129

130-
if ($searchResult instanceof ExtraSearchResult) {
130+
if ($searchResult instanceof ExtraSearchResult && $searchResult->suggestion instanceof Suggestion) {
131131
$this->suggestion = $searchResult->suggestion;
132132
}
133133

0 commit comments

Comments
 (0)