Fatal error: Uncaught Error: Call to a member function getId() on null in magenerds-base-price/Model/Plugin/AfterPrice.php:92
Stack trace:
#0 magenerds-base-price/Model/Plugin/AfterPrice.php(68): Magenerds\BasePrice\Model\Plugin\AfterPrice->getAfterPriceHtml(NULL)
#1 vendor/magento/framework/Interception/Interceptor.php(135): Magenerds\BasePrice\Model\Plugin\AfterPrice->aroundRender(Object(Magento\Framework\Pricing\Render\Interceptor), Object(Closure), 'final_price', Object(Magento\Catalog\Model\Product\Interceptor), Array)
#2 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\Pricing\Render\Interceptor->Magento\Framework\Interception\{closure}('final_price', Object(Magento\Catalog\Model\Product\Interceptor), Array)
#3 generated/code/Magento/Framework/Pricing/Render/Interceptor.php(26): Magento\Framework\Pricing\Render\Interceptor-> in magenerds-base-price/Model/Plugin/AfterPrice.php on line 92
A simple check for $product is enough as it is done for the original product in the beginning of this method.
// check if product is available
if (!$product) return '';
https://github.com/Magenerds/BasePrice/blob/9b5d703f2db3f2c940f680449bcfc88b16a9fd5e/Model/Plugin/AfterPrice.php#L110
A simple check for $product is enough as it is done for the original product in the beginning of this method.