Posted on

Error: Call to a member function getCode() – Magento 2

Hi i am working on magento 2, and I have the following error

Error: Call to a member function getCode() on null in /vendor/magento/module-store/App/Action/Plugin/Context.php:148 Stack trace: #0 /vendor/magento/module-store/App/Action/Plugin/Context.php(100): MagentoStoreAppActionPluginContext->updateContext(Object(MagentoFrameworkAppRequestHttp), Object(MagentoStoreModelStoreInterceptor)) #1 /vendor/magento/framework/Interception/Interceptor.php(121): MagentoStoreAppActionPluginContext->beforeDispatch(Object(MagentoCmsControllerIndexIndexInterceptor), Object(MagentoFrameworkAppRequestHttp)) #2 /vendor/magento/framework/Interception/Interceptor.php(153): MagentoCmsControllerIndexIndexInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoFrameworkAppRequestHttp)) #3 /generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php(32): MagentoCmsControllerIndexIndexInterceptor->___callPlugins(‘dispatch’, Array, Array) #4 /vendor/magento/framework/App/FrontController.php(186): MagentoCmsControllerIndexIndexInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp)) #5 /vendor/magento/framework/App/FrontController.php(118): MagentoFrameworkAppFrontController->processRequest(Object(MagentoFrameworkAppRequestHttp), Object(MagentoCmsControllerIndexIndexInterceptor)) #6 /vendor/magento/framework/Interception/Interceptor.php(58): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp)) #7 /vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkAppFrontControllerInterceptor->___callParent(‘dispatch’, Array) #8 /vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(99): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoFrameworkAppRequestHttp)) #9 /vendor/magento/framework/Interception/Interceptor.php(135): MagentoStoreAppFrontControllerPluginRequestPreprocessor->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp)) #10 /vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(75): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoFrameworkAppRequestHttp)) #11 /vendor/magento/framework/Interception/Interceptor.php(135): MagentoPageCacheModelAppFrontControllerBuiltinPlugin->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp)) #12 /vendor/magento/framework/Interception/Interceptor.php(153): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoFrameworkAppRequestHttp)) #13 /generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins(‘dispatch’, Array, NULL) #14 /vendor/magento/framework/App/Http.php(116): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp)) #15 /generated/code/Magento/Framework/App/Http/Interceptor.php(23): MagentoFrameworkAppHttp->launch() #16 /vendor/magento/framework/App/Bootstrap.php(263): MagentoFrameworkAppHttpInterceptor->launch() #17 /pub/index.php(29): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttpInterceptor)) #18 {main}

Suggest me How to solve this problem.

Leave a Reply

Your email address will not be published.