Skip to content

Commit 90019bc

Browse files
committed
Fix call on null object whilst role is without default store view
1 parent 9c0903a commit 90019bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Plugin/Model/HideDefaultStoreCode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public function __construct(
3737
*/
3838
public function afterGetBaseUrl(\Magento\Store\Model\Store $subject, $url)
3939
{
40-
if ($this->helper->isHideDefaultStoreCode()) {
41-
$url = str_replace('/'.$this->storeManager->getDefaultStoreView()->getCode().'/','/', $url);
40+
if ($this->helper->isHideDefaultStoreCode() && !is_null($this->storeManager->getDefaultStoreView())) {
41+
$url = str_replace('/'.$this->storeManager->getDefaultStoreView()->getCode().'/', '/', $url);
4242
}
4343
return $url;
4444
}

0 commit comments

Comments
 (0)