Skip to content

Commit 2d79756

Browse files
terriblebenthotegowda
authored andcommitted
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 facebook#13242 Differential Revision: D4812185 Pulled By: hramos fbshipit-source-id: 4b1c3c38f67cf59034a383c95d4280d1b6380300
1 parent 1d0c5d3 commit 2d79756

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

React/Base/RCTJSStackFrame.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ + (instancetype)stackFrameWithDictionary:(NSDictionary *)dict
7070
{
7171
return [[self alloc] initWithMethodName:dict[@"methodName"]
7272
file:dict[@"file"]
73-
lineNumber:[dict[@"lineNumber"] integerValue]
74-
column:[dict[@"column"] integerValue]];
73+
lineNumber:[RCTNilIfNull(dict[@"lineNumber"]) integerValue]
74+
column:[RCTNilIfNull(dict[@"column"]) integerValue]];
7575
}
7676

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

0 commit comments

Comments
 (0)