Skip to content

Commit fa80010

Browse files
committed
Merge remote-tracking branch 'troll/MAGETWO-47746' into MAGETWO-48042
2 parents 03f436f + 349fd4b commit fa80010

File tree

1 file changed

+10
-1
lines changed
  • app/code/Magento/Catalog/Controller/Adminhtml/Category

1 file changed

+10
-1
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Category/Edit.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,16 @@ public function execute()
5959
if ($storeId) {
6060
$categoryId = (int)$this->storeManager->getStore($storeId)->getRootCategoryId();
6161
} else {
62-
$categoryId = (int)$this->storeManager->getDefaultStoreView()->getRootCategoryId();
62+
$defaultStoreView = $this->storeManager->getDefaultStoreView();
63+
if ($defaultStoreView) {
64+
$categoryId = (int)$defaultStoreView->getRootCategoryId();
65+
} else {
66+
$stores = $this->storeManager->getStores();
67+
if (count($stores)) {
68+
$store = reset($stores);
69+
$categoryId = (int)$store->getRootCategoryId();
70+
}
71+
}
6372
}
6473
$this->getRequest()->setParam('id', $categoryId);
6574
}

0 commit comments

Comments
 (0)