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 https://github.com/facebook/react-native/pull/13242

Differential Revision: D4812185

Pulled By: hramos

fbshipit-source-id: 4b1c3c38f67cf59034a383c95d4280d1b6380300
This commit is contained in:
Ben Roth
2017-03-31 13:19:00 -07:00
committed by Facebook Github Bot
parent 92190727d1
commit 9075fe0618

View File

@@ -70,8 +70,8 @@ static NSRegularExpression *RCTJSStackFrameRegex()
{ {
return [[self alloc] initWithMethodName:dict[@"methodName"] return [[self alloc] initWithMethodName:dict[@"methodName"]
file:dict[@"file"] file:dict[@"file"]
lineNumber:[dict[@"lineNumber"] integerValue] lineNumber:[RCTNilIfNull(dict[@"lineNumber"]) integerValue]
column:[dict[@"column"] integerValue]]; column:[RCTNilIfNull(dict[@"column"]) integerValue]];
} }
+ (NSArray<RCTJSStackFrame *> *)stackFramesWithLines:(NSString *)lines + (NSArray<RCTJSStackFrame *> *)stackFramesWithLines:(NSString *)lines