Fatal error: Uncaught Error: Call to a member function getId() on null in /var/www/html/app/code/Bss/PreviousNextProduct/Block/PreviousNext.php:271
Stack trace:
#0 /var/www/html/app/code/Bss/PreviousNextProduct/view/frontend/templates/previous_next_control.phtml(33): Bss\PreviousNextProduct\Block\PreviousNext->getProductToCategory()
#1 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/html/a...')
#2 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render(Object(Bss\PreviousNextProduct\Block\PreviousNext), '/var/www/html/a...', Array)
#3 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent('render', Array)
#4 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}(Object(Bss\PreviousNextProduct\Block\PreviousNext), '/ in /var/www/html/app/code/Bss/PreviousNextProduct/Block/PreviousNext.php on line 271