Skip to content

Commit 6806985

Browse files
committed
handle exceptions from resumeExternalUserAgentFlowWithURL
1 parent f478a1d commit 6806985

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

GoogleSignIn/Sources/GIDSignIn.m

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,15 @@ @implementation GIDSignIn {
197197
- (BOOL)handleURL:(NSURL *)url {
198198
// Check if the callback path matches the expected one for a URL from Safari/Chrome/SafariVC.
199199
if ([url.path isEqual:kBrowserCallbackPath]) {
200-
if ([_currentAuthorizationFlow resumeExternalUserAgentFlowWithURL:url]) {
201-
_currentAuthorizationFlow = nil;
202-
return YES;
203-
}
204-
return NO;
200+
@try {
201+
if ([_currentAuthorizationFlow resumeExternalUserAgentFlowWithURL:url]) {
202+
_currentAuthorizationFlow = nil;
203+
return YES;
204+
}
205+
return NO;
206+
} @catch (NSException *exception) {
207+
return NO;
208+
}
205209
}
206210
// Check if the callback path matches the expected one for a URL from Google Device Policy app.
207211
if ([url.path isEqual:kEMMCallbackPath]) {

0 commit comments

Comments
 (0)