File tree 1 file changed +5
-2
lines changed
app/code/Magento/CatalogUrlRewrite/Model/Storage 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
179
179
unset($ data [UrlRewrite::IS_AUTOGENERATED ]);
180
180
$ categoryFromDb = $ this ->connection ->fetchRow ($ this ->prepareSelect ($ data ));
181
181
182
+ if ($ categoryFromDb === false ) {
183
+ return null ;
184
+ }
185
+
182
186
if ($ categoryFromDb [UrlRewrite::REDIRECT_TYPE ]) {
183
187
$ productFromDb [UrlRewrite::REDIRECT_TYPE ] = OptionProvider::PERMANENT ;
184
188
$ categoryPath = str_replace ($ categorySuffix , '' , $ categoryFromDb [UrlRewrite::TARGET_PATH ]);
185
189
}
186
190
187
- if ($ categoryFromDb === false
188
- || !$ productResource ->canBeShowInCategory (
191
+ if (!$ productResource ->canBeShowInCategory (
189
192
$ productFromDb [UrlRewrite::ENTITY_ID ],
190
193
$ categoryFromDb [UrlRewrite::ENTITY_ID ]
191
194
)
You can’t perform that action at this time.
0 commit comments