From c1ae4780ceb25fbb350e7f802fa150f4ee30ed74 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 6 Nov 2015 06:35:26 -0800 Subject: [PATCH] Fix crash in RCTLog Reviewed By: tadeuzagallo Differential Revision: D2625795 fb-gh-sync-id: 6983a2dc9259fa1777c05011c2752e9520aa26cd --- React/Base/RCTLog.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/Base/RCTLog.m b/React/Base/RCTLog.m index d6bf84590..b9360f449 100644 --- a/React/Base/RCTLog.m +++ b/React/Base/RCTLog.m @@ -225,7 +225,7 @@ void _RCTLogInternal( NSString *address = [[frameSymbols componentsSeparatedByString:@"0x"][1] componentsSeparatedByString:@" "][0]; NSRange addressRange = [frameSymbols rangeOfString:address]; NSString *methodName = [frameSymbols substringFromIndex:(addressRange.location + addressRange.length + 1)]; - if (idx == 1) { + if (idx == 1 && fileName) { NSString *file = [@(fileName) componentsSeparatedByString:@"/"].lastObject; [stack addObject:@{@"methodName": methodName, @"file": file, @"lineNumber": @(lineNumber)}]; } else {