diff --git a/packages/Webkul/SocialLogin/src/Repositories/CustomerSocialAccountRepository.php b/packages/Webkul/SocialLogin/src/Repositories/CustomerSocialAccountRepository.php index 6934c2ef8..ff43677f2 100644 --- a/packages/Webkul/SocialLogin/src/Repositories/CustomerSocialAccountRepository.php +++ b/packages/Webkul/SocialLogin/src/Repositories/CustomerSocialAccountRepository.php @@ -71,7 +71,7 @@ class CustomerSocialAccountRepository extends Repository if ($account) { return $account->customer; } else { - $customer = $this->customerRepository->findOneByField('email', $providerUser->getEmail()); + $customer = $providerUser->getEmail()?$this->customerRepository->findOneByField('email', $providerUser->getEmail()):null; if (! $customer) { $names = $this->getFirstLastName($providerUser->getName()); @@ -115,4 +115,4 @@ class CustomerSocialAccountRepository extends Repository 'last_name' => $lastName, ]; } -} \ No newline at end of file +}