@@ -105,11 +105,11 @@ private void setJSBundle(ReactInstanceManager instanceManager, String latestJSBu
105
105
Field bundleLoaderField = instanceManager .getClass ().getDeclaredField ("mBundleLoader" );
106
106
Class <?> jsBundleLoaderClass = Class .forName ("com.facebook.react.cxxbridge.JSBundleLoader" );
107
107
Method createFileLoaderMethod = null ;
108
+ String createFileLoaderMethodName = latestJSBundleFile .toLowerCase ().startsWith ("assets://" )
109
+ ? "createAssetLoader" : "createFileLoader" ;
108
110
109
111
Method [] methods = jsBundleLoaderClass .getDeclaredMethods ();
110
- for (Method method : methods ) {
111
- String createFileLoaderMethodName = latestJSBundleFile .toLowerCase ().startsWith ("assets://" )
112
- ? "createAssetLoader" : "createFileLoader" ;
112
+ for (Method method : methods ) {
113
113
if (method .getName ().equals (createFileLoaderMethodName )) {
114
114
createFileLoaderMethod = method ;
115
115
break ;
@@ -321,7 +321,7 @@ protected Void doInBackground(Void... params) {
321
321
JSONObject currentPackage = mUpdateManager .getCurrentPackage ();
322
322
323
323
if (currentPackage == null ) {
324
- promise .resolve (null );
324
+ promise .resolve ("" );
325
325
return null ;
326
326
}
327
327
@@ -335,14 +335,14 @@ protected Void doInBackground(Void... params) {
335
335
if (updateState == CodePushUpdateState .PENDING .getValue () && !currentUpdateIsPending ) {
336
336
// The caller wanted a pending update
337
337
// but there isn't currently one.
338
- promise .resolve (null );
338
+ promise .resolve ("" );
339
339
} else if (updateState == CodePushUpdateState .RUNNING .getValue () && currentUpdateIsPending ) {
340
340
// The caller wants the running update, but the current
341
341
// one is pending, so we need to grab the previous.
342
342
JSONObject previousPackage = mUpdateManager .getPreviousPackage ();
343
343
344
344
if (previousPackage == null ) {
345
- promise .resolve (null );
345
+ promise .resolve ("" );
346
346
return null ;
347
347
}
348
348
0 commit comments