From 9075fe06189a5d0cf237b1118bc8437d92968fd0 Mon Sep 17 00:00:00 2001 From: Ben Roth Date: Fri, 31 Mar 2017 13:19:00 -0700 Subject: [PATCH] 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 --- React/Base/RCTJSStackFrame.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/React/Base/RCTJSStackFrame.m b/React/Base/RCTJSStackFrame.m index 3f718326a..e102ed059 100644 --- a/React/Base/RCTJSStackFrame.m +++ b/React/Base/RCTJSStackFrame.m @@ -70,8 +70,8 @@ static NSRegularExpression *RCTJSStackFrameRegex() { 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 *)stackFramesWithLines:(NSString *)lines