Skip to content

Commit

Permalink
Fix crash in RCTJSStackFrame::stackFrameWithDictionary:
Browse files Browse the repository at this point in the history
Summary:
Motivation: When logging to RCTRedBox, if any of the stack frames lacks a line number or a column, the application will crash with `[NSNull integerValue]: unrecognized selector sent to instance`.
Closes #13242

Differential Revision: D4812185

Pulled By: hramos

fbshipit-source-id: 4b1c3c38f67cf59034a383c95d4280d1b6380300
  • Loading branch information
terribleben authored and facebook-github-bot committed Mar 31, 2017
1 parent 9219072 commit 9075fe0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions React/Base/RCTJSStackFrame.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ + (instancetype)stackFrameWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithMethodName:dict[@"methodName"]
file:dict[@"file"]
lineNumber:[dict[@"lineNumber"] integerValue]
column:[dict[@"column"] integerValue]];
lineNumber:[RCTNilIfNull(dict[@"lineNumber"]) integerValue]
column:[RCTNilIfNull(dict[@"column"]) integerValue]];
}

+ (NSArray<RCTJSStackFrame *> *)stackFramesWithLines:(NSString *)lines
Expand Down

0 comments on commit 9075fe0

Please sign in to comment.