We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff00d17 commit 1e2bcadCopy full SHA for 1e2bcad
app/code/Magento/PageBuilder/Model/Stage/Preview.php
@@ -95,7 +95,16 @@ public function startPreviewMode($callback, $storeId = null)
95
$this->isPreview = true;
96
97
if (!$storeId) {
98
- $storeId = $this->storeManager->getDefaultStoreView()->getId();
+ $store = $this->storeManager->getDefaultStoreView();
99
+ if ($store) {
100
+ $storeId = $store->getId();
101
+ } else {
102
+ $stores = $this->storeManager->getStores();
103
+ if (count($stores)) {
104
+ $store = array_shift($stores);
105
106
+ }
107
108
}
109
$this->emulation->startEnvironmentEmulation($storeId);
110
0 commit comments