I have cloud enterprise project with multi website. We are facing issue of null object is returned from getDefaultStore method.
I have created one admin role and given full access but assigned only selected website scope which we need.
And we using magento default login as customer functionality with that role and facing this error.and unable to login successfully.
I checked the default code and try to debug the issue but not get any luck.When we pass here getDefaultGroupId as static for that particular website then it’s working.
/**
* @inheritdoc
*/
public function getDefaultStoreView()
{
$defaultWebsite = $this->websiteRepository->getDefault();
$defaultStore = $this->getGroup($defaultWebsite->getDefaultGroupId())->getDefaultStore();
return $defaultStore ?: null;
}