Skip to content

Commit b5a2ef6

Browse files
AnujNehraAnujNehra
authored andcommitted
ACP2E-2212: Exception Error when trying to change Website in Customer > Company in Admin
1 parent 9f4a38d commit b5a2ef6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

app/code/Magento/Customer/Model/AccountManagement.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -923,12 +923,11 @@ public function createAccountWithPasswordHash(CustomerInterface $customer, $hash
923923
// Make sure we have a storeId to associate this customer with.
924924
if (!$customer->getStoreId()) {
925925
if ($customer->getWebsiteId()) {
926-
if ($this->storeManager->getWebsite($customer->getWebsiteId())->getDefaultStore() === null) {
927-
throw new InputException(
928-
__('Store and store view is required for this website.')
929-
);
926+
$website = $this->storeManager->getWebsite($customer->getWebsiteId());
927+
if ($website->getDefaultStore() === null) {
928+
throw new InputException(__('Store and store view is required for this website.'));
930929
}
931-
$storeId = $this->storeManager->getWebsite($customer->getWebsiteId())->getDefaultStore()->getId();
930+
$storeId = $website->getDefaultStore()->getId();
932931
} else {
933932
$this->storeManager->setCurrentStore(null);
934933
$storeId = $this->storeManager->getStore()->getId();

0 commit comments

Comments
 (0)