Smile-SA / magento2-module-product-label

Module to handle custom labels with images on products
Open Software License 3.0
53 stars 34 forks source link

Fix typing in ProductLabel Block #53

Closed florent-maissiat-smile closed 1 year ago

florent-maissiat-smile commented 1 year ago

As the file declare as strict, \Smile\ProductLabel\Block\ProductLabel\ProductLabel::getProduct can't set $this->product as null, but on empty category, $this->registry->registry('current_product') can be null. This cause PHP to raise a fatal error.

This PR fix the issue by allowing $this->product to be null

florent-maissiat-smile commented 1 year ago

I close the PR as the change have been done outside of it by aebb0b7c1ebd67abd7dd41af9f01da7e6dec9ac6