Skip to content

Commit

Permalink
SMM-5 add empty array check
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwaclawczyk committed Jan 8, 2025
1 parent 663c55f commit 1f99606
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Block/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ private function fetchData()
$this->nodeTypeProvider->prepareData($type, array_column($nodes, 'node'));
}

foreach ($types['category'] as $nodes) {
foreach ($types['category'] ?? [] as $nodes) {
$categoryProvider = $this->nodeTypeProvider->getProvider('category');
$productCount = $categoryProvider->getCategoryProductCount($nodes['node']->getNodeId());
if (empty($productCount) && $nodes['node']->getHideIfEmpty()) {
Expand Down

0 comments on commit 1f99606

Please sign in to comment.