Skip to content

Commit 3f9889c

Browse files
author
Dmytro Poperechnyy
committed
MAGETWO-44327: Fatal error trying to create catalog price rule when there is website with no store
1 parent 9b1f7f5 commit 3f9889c

File tree

1 file changed

+4
-0
lines changed
  • app/code/Magento/CatalogRule/Model

1 file changed

+4
-0
lines changed

app/code/Magento/CatalogRule/Model/Rule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,10 @@ protected function _getWebsitesMap()
342342
$map = [];
343343
$websites = $this->_storeManager->getWebsites(true);
344344
foreach ($websites as $website) {
345+
// Continue if website has no store to be able to create catalog rule for website without store
346+
if ($website->getDefaultStore() === null) {
347+
continue;
348+
}
345349
$map[$website->getId()] = $website->getDefaultStore()->getId();
346350
}
347351
return $map;

0 commit comments

Comments
 (0)