Skip to content

Commit

Permalink
Optimization protection highlight loop in content category and product
Browse files Browse the repository at this point in the history
  • Loading branch information
Torsten Freyda committed Feb 24, 2024
1 parent 8cadf48 commit fdb22e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Search/Content/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function createCategoryCollection(

$category = $categories->get($sourceValue);

if(array_key_exists('highlight', $item)) {
if(array_key_exists('highlight', $item) && is_array($item['highlight'])) {

foreach ($item['highlight'] as $highlightKey => $highlightValue) {

Expand Down
2 changes: 1 addition & 1 deletion src/Search/Content/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function createSalesChannelProductCollection(

$salesChannelProduct = $salesChannelProducts->get($sourceValue);

if(array_key_exists('highlight', $item) && $item['highlight']) {
if(array_key_exists('highlight', $item) && is_array($item['highlight'])) {

foreach ($item['highlight'] as $highlightKey => $highlightValue) {

Expand Down

0 comments on commit fdb22e2

Please sign in to comment.