From 405dfec0026e6be2c11281d31774f08a293ded2d Mon Sep 17 00:00:00 2001 From: Stanislav Ilnytskyi Date: Fri, 14 Feb 2020 14:00:50 +0100 Subject: [PATCH] Product not exist fix when attempt to get an image --- app/code/Magento/Catalog/Helper/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Helper/Image.php b/app/code/Magento/Catalog/Helper/Image.php index 5b0aa0c496ecd..085fb2c224b14 100644 --- a/app/code/Magento/Catalog/Helper/Image.php +++ b/app/code/Magento/Catalog/Helper/Image.php @@ -514,7 +514,7 @@ protected function initBaseFile() if ($this->getImageFile()) { $model->setBaseFile($this->getImageFile()); } else { - $model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir())); + $model->setBaseFile($this->getProduct() ? $this->getProduct()->getData($model->getDestinationSubdir()) : ''); } } return $this;