File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
app/code/Magento/CatalogUrlRewrite/Model/Storage Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -179,13 +179,16 @@ private function findProductRewriteByRequestPath(array $data): ?array
179179 unset($ data [UrlRewrite::IS_AUTOGENERATED ]);
180180 $ categoryFromDb = $ this ->connection ->fetchRow ($ this ->prepareSelect ($ data ));
181181
182+ if ($ categoryFromDb === false ) {
183+ return null ;
184+ }
185+
182186 if ($ categoryFromDb [UrlRewrite::REDIRECT_TYPE ]) {
183187 $ productFromDb [UrlRewrite::REDIRECT_TYPE ] = OptionProvider::PERMANENT ;
184188 $ categoryPath = str_replace ($ categorySuffix , '' , $ categoryFromDb [UrlRewrite::TARGET_PATH ]);
185189 }
186190
187- if ($ categoryFromDb === false
188- || !$ productResource ->canBeShowInCategory (
191+ if (!$ productResource ->canBeShowInCategory (
189192 $ productFromDb [UrlRewrite::ENTITY_ID ],
190193 $ categoryFromDb [UrlRewrite::ENTITY_ID ]
191194 )
You can’t perform that action at this time.
0 commit comments