Skip to content

Commit

Permalink
Prevent crash on error#localizedFailureReason
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemonteith committed Feb 13, 2017
1 parent d9babd5 commit ed04e4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/Firestack/FirestackAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ @implementation FirestackAuth
props: @{
@"eventName": @"userTokenError",
@"authenticated": @((BOOL)false),
@"errorMessage": [error localizedFailureReason]
@"errorMessage": [error localizedDescription]
}];
} else {
[self
Expand Down

2 comments on commit ed04e4b

@ghuh
Copy link

@ghuh ghuh commented on ed04e4b Feb 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is correct according to https://firebase.google.com/docs/auth/ios/errors. NSLocalizedDescriptionKey (i.e. localizedDescription) is set for all NSError. NSLocalizedFailureReasonErrorKey (i.e. localizedFailureReason) is only set for certain errors and none of the errors for getTokenWithCompletion set it.

I'm convinced we can close out fullstackreact#256 when this gets merged.

@ghuh
Copy link

@ghuh ghuh commented on ed04e4b Feb 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also worth noting that this change has already been made in v3

Please sign in to comment.