Skip to content

Commit 3af62ed

Browse files
authored
Merge pull request #6 from cuongmits/bug/fix-call-on-null-object
Fix call on null object whilst role is without default store view
2 parents 9c0903a + 90019bc commit 3af62ed

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)