Skip to content

Commit

Permalink
Fix crash that happens when Firebase API key gets revoked
Browse files Browse the repository at this point in the history
Fixes fullstackreact#318

This has been really hard to reproduce and track down: When an API key gets revoked the stored auth token is not valid any more, causing this error. `error localizedFailureReason` doesn't contain anything in that case, so it's `nil`, causing Objective-C to crash as you can't have it as a value for a dictionary. 

It's probably save to have the default text here, but feel free to tweak it and modify the PR directly as necessary.

Let me know if you have any other questions. I'm using `firestack` for my side project [wwdc.family](https://wwdc.family) 👍
  • Loading branch information
KrauseFx authored May 17, 2017
1 parent 4937825 commit 5b777bf
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": @"An error occured, please try again"
}];
} else {
[self
Expand Down

0 comments on commit 5b777bf

Please sign in to comment.