Yoast-SEO-for-Magento2
Yoast-SEO-for-Magento2 copied to clipboard
Only get logo src when logo block actually exists
We have a modified design for one of our clients and the logo block doesn't exist anymore. We now get this warning;
Fatal error: Uncaught Error: Call to a member function getLogoSrc() on boolean in /data/imaginerun/magento2/vendor/maxserv/magento-module-yoastseo/Block/Schema/Organization.php on line <i>44</i>
Due to this line; https://github.com/Yoast/Yoast-SEO-for-Magento2/blob/8c228d002f3b538438c211205f755638d955b5e9/Block/Schema/Organization.php#L24
It would be great to return null when the block doesn't exist like so
return $logoBlock ? $logoBlock->getLogoSrc() : null;
Same problem here !