Skip to content

Commit

Permalink
Update Classes/Common/SolrSearchResult/ResultDocument.php
Browse files Browse the repository at this point in the history
Add check if array is not null, if not assign it, else assign empty array.

Co-authored-by: Alexander Bigga <[email protected]>
  • Loading branch information
beatrycze-volk and Alexander Bigga committed Apr 14, 2021
1 parent 9d81a14 commit ffd1342
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/Common/SolrSearchResult/ResultDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function __construct($record, $highlighting, $fields) {
$this->page = $record[$fields['page']];

$highlightingForRecord = $highlighting[$record[$fields['id']]][$fields['fulltext']];
$this->snippetsForRecord = $highlightingForRecord['snippets'];
$this->snippetsForRecord = is_array($highlightingForRecord['snippets']) ? $highlightingForRecord['snippets'] : [];

$this->parseSnippets();
$this->parsePages();
Expand Down

0 comments on commit ffd1342

Please sign in to comment.