From 05996963c9e808034a49ad51711e8d4e4f100da4 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Wed, 4 Nov 2015 12:04:56 -0800 Subject: [PATCH] Cleanup RedBox display of native errors Reviewed By: nicklockwood Differential Revision: D2615507 fb-gh-sync-id: 94f8013b418a3b95508cc55b9302fde4325bfcbf --- React/Modules/RCTRedBox.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/React/Modules/RCTRedBox.m b/React/Modules/RCTRedBox.m index 6abb6dd7a..a334c7533 100644 --- a/React/Modules/RCTRedBox.m +++ b/React/Modules/RCTRedBox.m @@ -193,8 +193,14 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder) } cell.textLabel.text = stackFrame[@"methodName"]; - cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ @ %@:%@", - [stackFrame[@"file"] lastPathComponent], stackFrame[@"lineNumber"], stackFrame[@"column"]]; + if (stackFrame[@"file"]) { + cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ @ %zd:%zd", + [stackFrame[@"file"] lastPathComponent], + [stackFrame[@"lineNumber"] integerValue], + [stackFrame[@"column"] integerValue]]; + } else { + cell.detailTextLabel.text = @""; + } return cell; }