TypeError: trim() expects parameter 1 to be string, null given in /var/www/html/app/code/Diana/SkuSearch/Observer/RedirectToProduct.php:48 Stack trace: #0 /var/www/html/app/code/Diana/SkuSearch/Observer/RedirectToProduct.php(48): trim(NULL) #1 /var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(88): Diana\SkuSearch\Observer\RedirectToProduct->execute(Object(Magento\Framework\Event\Observer)) #2 /var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(74): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Diana\SkuSearch\Observer\RedirectToProduct), Object(Magento\Framework\Event\Observer)) #3 /var/www/html/vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer)) #4 /var/www/html/generated/code/Magento/Framework/Event/Manager/Proxy.php(95): Magento\Framework\Event\Manager->dispatch('controller_acti...', Array) #5 /var/www/html/vendor/magento/framework/App/Action/Plugin/EventDispatchPlugin.php(115): Magento\Framework\Event\Manager\Proxy->dispatch('controller_acti...', Array) #6 /var/www/html/vendor/magento/framework/App/Action/Plugin/EventDispatchPlugin.php(60): Magento\Framework\App\Action\Plugin\EventDispatchPlugin->dispatchPreDispatchEvents(Object(Mageplaza\AjaxLayer\Controller\Search\Result\Index\Interceptor)) #7 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(121): Magento\Framework\App\Action\Plugin\EventDispatchPlugin->beforeExecute(Object(Mageplaza\AjaxLayer\Controller\Search\Result\Index\Interceptor)) #8 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Mageplaza\AjaxLayer\Controller\Search\Result\Index\Interceptor->Magento\Framework\Interception\{closure}() #9 /var/www/html/generated/code/Mageplaza/AjaxLayer/Controller/Search/Result/Index/Interceptor.php(26): Mageplaza\AjaxLayer\Controller\Search\Result\Index\Interceptor->___callPlugins('execute', Array, Array) #10 /var/www/html/vendor/magento/framework/App/Action/Action.php(111): Mageplaza\AjaxLayer\Controller\Search\Result\Index\Interceptor->execute() #11 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #12 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Mageplaza\AjaxLayer\Controller\Search\Result\Index\Interceptor->___callParent('dispatch', Array) #13 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Mageplaza\AjaxLayer\Controller\Search\Result\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #14 /var/www/html/generated/code/Mageplaza/AjaxLayer/Controller/Search/Result/Index/Interceptor.php(39): Mageplaza\AjaxLayer\Controller\Search\Result\Index\Interceptor->___callPlugins('dispatch', Array, Array) #15 /var/www/html/vendor/magento/framework/App/FrontController.php(186): Mageplaza\AjaxLayer\Controller\Search\Result\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #16 /var/www/html/vendor/magento/framework/App/FrontController.php(118): Magento\Framework\App\FrontController->processRequest(Object(Magento\Framework\App\Request\Http), Object(Mageplaza\AjaxLayer\Controller\Search\Result\Index\Interceptor)) #17 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http)) #18 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array) #19 /var/www/html/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(99): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #20 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http)) #21 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(71): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #22 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http)) #23 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #24 /var/www/html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL) #25 /var/www/html/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #26 /var/www/html/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http->launch() #27 /var/www/html/pub/index.php(40): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor)) #28 {main}