diff --git a/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php b/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php index 17f0651cd5ff6..ae43381d32288 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/Configurable.php @@ -65,7 +65,11 @@ public function getProductForThumbnail() self::CONFIG_THUMBNAIL_SOURCE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE ) == ThumbnailSource::OPTION_USE_PARENT_IMAGE || - !($this->getChildProduct()->getThumbnail() && $this->getChildProduct()->getThumbnail() != 'no_selection') + !( + $this->getChildProduct() && + $this->getChildProduct()->getThumbnail() && + $this->getChildProduct()->getThumbnail() != 'no_selection' + ) ) { $product = $this->getProduct(); } else { diff --git a/app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php b/app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php index 3a9ed653305c5..67e51b3797540 100644 --- a/app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php +++ b/app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php @@ -63,7 +63,11 @@ protected function getProductForThumbnail() ); $product = $config == ThumbnailSource::OPTION_USE_PARENT_IMAGE - || (!$this->getChildProduct()->getThumbnail() || $this->getChildProduct()->getThumbnail() == 'no_selection') + || ( + !$this->getChildProduct() || + !$this->getChildProduct()->getThumbnail() || + $this->getChildProduct()->getThumbnail() == 'no_selection' + ) ? $this->getProduct() : $this->getChildProduct();