diff --git a/FirebaseAuthUI/Sources/FUIAuth.m b/FirebaseAuthUI/Sources/FUIAuth.m index 464fe959b09..0d43914ed76 100644 --- a/FirebaseAuthUI/Sources/FUIAuth.m +++ b/FirebaseAuthUI/Sources/FUIAuth.m @@ -201,7 +201,8 @@ - (void)signInWithProviderUI:(id)providerUI [self.auth signInWithCredential:credential completion:^(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error) { - if (error && error.code == FIRAuthErrorCodeAccountExistsWithDifferentCredential) { + if (self.emailAuthProvider && error + && error.code == FIRAuthErrorCodeAccountExistsWithDifferentCredential) { NSString *email = error.userInfo[kErrorUserInfoEmailKey]; [self.emailAuthProvider handleAccountLinkingForEmail:email newCredential:credential