From 7123618aa863ab384d4091c52e9362a9afbbdec1 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Tue, 3 Jan 2017 10:23:08 -0800 Subject: [PATCH] Fix comparison between NSNumber* and int Summary: Strangely comparing a pointer with zero will only be a clang warning when compiling with `-Wpedantic`, so this incorrect comparison is silently allowed. **Test plan** Compiles with `-Wpedantic`. Closes https://github.com/facebook/react-native/pull/11709 Differential Revision: D4377512 Pulled By: ericvicenti fbshipit-source-id: 483cf1f41d3f539c452d542ad2155c4c4b41616d --- React/Base/RCTJavaScriptLoader.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/Base/RCTJavaScriptLoader.mm b/React/Base/RCTJavaScriptLoader.mm index 2f296acad..1d0f3cdec 100755 --- a/React/Base/RCTJavaScriptLoader.mm +++ b/React/Base/RCTJavaScriptLoader.mm @@ -29,7 +29,7 @@ NSString *const RCTJavaScriptLoaderErrorDomain = @"RCTJavaScriptLoaderErrorDomai NSMutableString *desc = [NSMutableString new]; [desc appendString:_status ?: @"Loading"]; - if (_total > 0) { + if ([_total integerValue] > 0) { [desc appendFormat:@" %ld%% (%@/%@)", (long)(100 * [_done integerValue] / [_total integerValue]), _done, _total]; } [desc appendString:@"\u2026"];