Permalink
Browse files

Fix crash in `RCTJSStackFrame::stackFrameWithDictionary:`

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 9075fe06189a5d0cf237b1118bc8437d92968fd0
Showing with 2 additions and 2 deletions.
  1. +2 −2 React/Base/RCTJSStackFrame.m
@@ -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

0 comments on commit 9075fe0

Please sign in to comment.