Skip to content

Commit 5f1cd5d

Browse files
authored
Update FUIAuth.m
Prevent an error from being swallowed in the case of FIRAuthErrorCodeAccountExistsWithDifferentCredential when the emailAiuthProvider is nil.
1 parent 6568775 commit 5f1cd5d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

FirebaseAuthUI/Sources/FUIAuth.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
201201
[self.auth signInWithCredential:credential
202202
completion:^(FIRAuthDataResult *_Nullable authResult,
203203
NSError *_Nullable error) {
204-
if (error && error.code == FIRAuthErrorCodeAccountExistsWithDifferentCredential) {
204+
if (self.emailAuthProvider && error
205+
&& error.code == FIRAuthErrorCodeAccountExistsWithDifferentCredential) {
205206
NSString *email = error.userInfo[kErrorUserInfoEmailKey];
206207
[self.emailAuthProvider handleAccountLinkingForEmail:email
207208
newCredential:credential

0 commit comments

Comments
 (0)