@@ -235,7 +235,7 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
235235 originalError: error
236236 completion: ^(FIRAuthDataResult *_Nullable authResult,
237237 NSError *_Nullable error,
238- FIRAuthCredential *_Nullable credential ) {
238+ FIRAuthCredential *_Nullable existingCredential ) {
239239 if (error) {
240240 completeSignInBlock (nil , error);
241241 return ;
@@ -325,7 +325,9 @@ - (void)signInWithEmailHint:(NSString *)emailHint
325325 [self .auth fetchProvidersForEmail: emailHint completion: ^(NSArray <NSString *> *_Nullable providers,
326326 NSError *_Nullable error) {
327327 if (error) {
328- completion (nil , error, nil );
328+ if (completion) {
329+ completion (nil , error, nil );
330+ }
329331 return ;
330332 }
331333 NSString *existingFederatedProviderID = [self authProviderFromProviders: providers];
@@ -359,7 +361,7 @@ - (void)signInWithEmailHint:(NSString *)emailHint
359361 completion (nil , originalError, nil );
360362 }
361363 }];
362- } else {
364+ } else { // Federated sign-in case.
363365 id <FUIAuthProvider> authProviderUI;
364366 // Retrieve the FUIAuthProvider instance from FUIAuth for the existing provider ID.
365367 for (id <FUIAuthProvider> provider in self.providers ) {
@@ -418,6 +420,9 @@ - (void)signInWithEmailHint:(NSString *)emailHint
418420 }
419421 }];
420422 }
423+ if (completion) {
424+ completion (authResult, error, credential);
425+ }
421426 }];
422427 }];
423428 }
0 commit comments