Skip to content

Commit 6a39c71

Browse files
authored
Fixes error handling when parsing tokens. (#1131)
1 parent e36cc96 commit 6a39c71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Firebase/Auth/Source/FIRUser.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ - (void)getIDTokenResultForcingRefresh:(BOOL)forceRefresh
843843
"error" out parameter.
844844
*/
845845
- (FIRAuthTokenResult *)parseIDToken:(NSString *)token error:(NSError **)error {
846-
error = nil;
846+
*error = nil;
847847
NSArray *tokenStringArray = [token componentsSeparatedByString:@"."];
848848
// The token payload is always the second index of the array.
849849
NSMutableString *tokenPayload = [[NSMutableString alloc] initWithString:tokenStringArray[1]];
@@ -863,7 +863,7 @@ - (FIRAuthTokenResult *)parseIDToken:(NSString *)token error:(NSError **)error {
863863
[NSJSONSerialization JSONObjectWithData:decodedTokenPayloadData
864864
options:NSJSONReadingMutableContainers|NSJSONReadingAllowFragments
865865
error:error];
866-
if (error) {
866+
if (*error) {
867867
return nil;
868868
}
869869

0 commit comments

Comments
 (0)