Skip to content

Commit eecd424

Browse files
Fix: Invalid argument supplied for foreach()
Warning: Invalid argument supplied for foreach() in /var/www/html/vendor/magepal/magento2-googletagmanager/Block/Data/Product.php on line 151
1 parent 9f424a8 commit eecd424

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Block/Data/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ protected function getProductCategoryName()
146146
protected function getBreadCrumbPath()
147147
{
148148
$titleArray = [];
149-
$breadCrumbs = $this->catalogHelper->getBreadcrumbPath();
149+
$breadCrumbs = $this->catalogHelper->getBreadcrumbPath() ?? [];
150150

151151
foreach ($breadCrumbs as $breadCrumb) {
152152
$titleArray[] = $breadCrumb['label'];

0 commit comments

Comments
 (0)