Skip to content

Commit 0fabd9f

Browse files
committed
Ensure that the cleanup method does not cause a crash due to accountType being nil.
As this should never be called anyway just be safe. Thanks to @mdamjanic7 for pointing out crashes caused by this.
1 parent 8f7474f commit 0fabd9f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/OAuth2Client/NXOAuth2AccountStore.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,9 @@ - (void)oauthClientDidLoseAccessToken:(NXOAuth2Client *)client;
511511
NSString *accountType;
512512
@synchronized (self.pendingOAuthClients) {
513513
accountType = [self accountTypeOfPendingOAuthClient:client];
514-
[self.pendingOAuthClients removeObjectForKey:accountType];
514+
if (accountType) {
515+
[self.pendingOAuthClients removeObjectForKey:accountType];
516+
}
515517
}
516518
}
517519

0 commit comments

Comments
 (0)