Skip to content

Commit

Permalink
Merge pull request #3799 from bbirman/dictionary-crash
Browse files Browse the repository at this point in the history
Add nil check for crash
  • Loading branch information
bbirman authored Jan 11, 2025
2 parents 6057284 + 6cf01c0 commit eec01c6
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ - (void)completeWithSuccess {
if (self.completionBlock) {
dispatch_async(dispatch_get_main_queue(), ^{
SFUserAccount *account = [[SFUserAccountManager sharedInstance] accountForCredentials:self.credentials];
NSDictionary *userInfo = @{ kSFNotificationUserInfoAccountKey : account };
NSMutableDictionary *userInfo = [NSMutableDictionary new];
if (account) {
[userInfo setValue:account forKey:kSFNotificationUserInfoAccountKey];
} else {
[SFSDKCoreLogger e:[self class] format:@"%@ No account for credentials", NSStringFromSelector(_cmd)];
}
[[NSNotificationCenter defaultCenter] postNotificationName:kSFNotificationUserDidRefreshToken
object:self
userInfo:userInfo];
Expand Down

0 comments on commit eec01c6

Please sign in to comment.