Skip to content

restorePreviousSignInWithCompletion() call crash if the completion is null #289

@gfoldv

Description

@gfoldv
- (void)restorePreviousSignInWithCompletion:(nullable void (^)(GIDGoogleUser *_Nullable user,
                                                               NSError *_Nullable error))completion {
  [self signInWithOptions:[GIDSignInInternalOptions silentOptionsWithCompletion:
                           ^(GIDSignInResult *signInResult, NSError *error) {
    if (signInResult) {
      completion(signInResult.user, nil);
    } else {
      completion(nil, error);
    }
  }]];
}

The method is defined with Nullable completion parameter, however it is not checked at execution, therefore it crashes.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriageIssues that need to be triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions