From bb997f01d81ecc6dfe1ff42b30b0493018a6fa88 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 1 Jun 2017 14:12:07 +0300 Subject: [PATCH] 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 --- .../com/microsoft/codepush/react/CodePushNativeModule.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java b/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java index e8ccd9f..fbf7134 100644 --- a/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +++ b/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java @@ -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; }