Skip to content

Commit

Permalink
Fix: Invalid argument supplied for foreach()
Browse files Browse the repository at this point in the history
Warning: Invalid argument supplied for foreach() in /var/www/html/vendor/magepal/magento2-googletagmanager/Block/Data/Product.php on line 151
  • Loading branch information
ilya-kudravets authored Nov 24, 2020
1 parent 9f424a8 commit eecd424
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Block/Data/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected function getProductCategoryName()
protected function getBreadCrumbPath()
{
$titleArray = [];
$breadCrumbs = $this->catalogHelper->getBreadcrumbPath();
$breadCrumbs = $this->catalogHelper->getBreadcrumbPath() ?? [];

foreach ($breadCrumbs as $breadCrumb) {
$titleArray[] = $breadCrumb['label'];
Expand Down

0 comments on commit eecd424

Please sign in to comment.