From 3ae1a1837d19de42fdb276d3edabbb7c501ed65e Mon Sep 17 00:00:00 2001 From: Konstantin Varlamov Date: Sat, 20 Jul 2019 18:01:40 -0400 Subject: Fix GTMGoogleTestRunner triggering "NULL cString" exception in NSString. --- UnitTesting/GTMGoogleTestRunner.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UnitTesting/GTMGoogleTestRunner.mm b/UnitTesting/GTMGoogleTestRunner.mm index 0bcb500..018f815 100644 --- a/UnitTesting/GTMGoogleTestRunner.mm +++ b/UnitTesting/GTMGoogleTestRunner.mm @@ -86,7 +86,8 @@ class GoogleTestPrinter : public EmptyTestEventListener { virtual void OnTestPartResult(const TestPartResult &test_part_result) { if (!test_part_result.passed()) { - NSString *file = @(test_part_result.file_name()); + const char *file_name = test_part_result.file_name(); + NSString *file = @(file_name ? file_name : ""); int line = test_part_result.line_number(); NSString *summary = @(test_part_result.summary()); -- cgit v1.2.3