M2.4.7, v1.5.3: $parent is set to null but needs to be checked before any function is called

Created by Esther Nguyen, Modified on Mon, 13 Apr at 2:49 AM by Support Agent

ISSUE:


I'm getting the following exception:


Error: Call to a member function getName() on null in /Users/gaz/Sites/nws2/http/vendor/bsscommerce/simple-detail-configurable/Helper/ProductData.php:310


This is because the recent changes added to your module. It's fine that $parent is set to null but it needs to be checked before any function is called on it.


SOLUTION:


To resolve the issue, please edit the file app/code/Bss/Simpledetailconfigurable/Helper/ProductData.php as below:


If you need any further assistance, please feel free to contact us. We'd be happy to support you!


Don't forget that we are a trusted Magento 2 extensions provider with 14+ years of experience, serving 75,000+ customers worldwide. We are an Adobe Commerce Solution Bronze Partner and a Select Magento Extensions Builder, reinforcing our expertise in the Magento ecosystem.


BSS Commerce specialize in developing 150+ high-quality Magento 2 extensions that enhance functionality, improve user experience, and support scalable growth. Our reputation is built on long-term partnerships, positive feedback, and proven performance-driven solutions.


Looking for more at https://bsscommerce.com/magento-2-extensions.html 

Here are some extensions that your store might need:


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article