mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-05-19 19:39:54 +08:00
Fix return value for get update metadata (#864)
* Fixed issue with error on parsing plist path See https://github.com/Microsoft/react-native-code-push/issues/534#issuecomment-302069326 for details * Changed return value to null for getUpdateMetadata instead of empty string In accordance with docs and https://github.com/Microsoft/react-native-code-push/issues/862
This commit is contained in:
@@ -321,7 +321,7 @@ public class CodePushNativeModule extends ReactContextBaseJavaModule {
|
||||
JSONObject currentPackage = mUpdateManager.getCurrentPackage();
|
||||
|
||||
if (currentPackage == null) {
|
||||
promise.resolve("");
|
||||
promise.resolve(null);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -335,14 +335,14 @@ public class CodePushNativeModule extends ReactContextBaseJavaModule {
|
||||
if (updateState == CodePushUpdateState.PENDING.getValue() && !currentUpdateIsPending) {
|
||||
// The caller wanted a pending update
|
||||
// but there isn't currently one.
|
||||
promise.resolve("");
|
||||
promise.resolve(null);
|
||||
} else if (updateState == CodePushUpdateState.RUNNING.getValue() && currentUpdateIsPending) {
|
||||
// The caller wants the running update, but the current
|
||||
// one is pending, so we need to grab the previous.
|
||||
JSONObject previousPackage = mUpdateManager.getPreviousPackage();
|
||||
|
||||
if (previousPackage == null) {
|
||||
promise.resolve("");
|
||||
promise.resolve(null);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user