From bbb7bef539f418bdb452e40987d399c9369df5a2 Mon Sep 17 00:00:00 2001 From: Jimmy Zhang Date: Tue, 21 Jul 2020 09:52:55 -0700 Subject: [PATCH] Remove unnecessary packager running check when saved JSLocation is empty Summary: Changelog: When the JSLocation is nil, checking whether the address is running is unnesarry and wasting time, adding a JSLocation length check to mitigate that. Reviewed By: cpojer Differential Revision: D22644574 fbshipit-source-id: c51fc1a8976ebc25cba2653581e1bfa479a1d70d --- React/Base/RCTBundleURLProvider.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/Base/RCTBundleURLProvider.mm b/React/Base/RCTBundleURLProvider.mm index 0a487289eb0..6781f034ebb 100644 --- a/React/Base/RCTBundleURLProvider.mm +++ b/React/Base/RCTBundleURLProvider.mm @@ -126,7 +126,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort) { NSString *location = [self jsLocation]; #if RCT_DEV_MENU - if (![RCTBundleURLProvider isPackagerRunning:location]) { + if ([location length] && ![RCTBundleURLProvider isPackagerRunning:location]) { location = nil; } #endif