Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit bed7005

Browse files
committed
handle exception silently
1 parent ba76161 commit bed7005

File tree

1 file changed

+4
-1
lines changed
  • android/app/src/main/java/com/microsoft/codepush/react

1 file changed

+4
-1
lines changed

android/app/src/main/java/com/microsoft/codepush/react/CodePush.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import android.content.pm.PackageInfo;
2424
import android.content.pm.PackageManager;
2525
import android.os.AsyncTask;
26+
import android.util.Log;
2627

2728
import org.json.JSONException;
2829
import org.json.JSONObject;
@@ -49,6 +50,7 @@ public class CodePush {
4950
private final String PENDING_UPDATE_WAS_INITIALIZED_KEY = "wasInitialized";
5051
private final String ASSETS_BUNDLE_PREFIX = "assets://";
5152
private final String CODE_PUSH_PREFERENCES = "CodePush";
53+
private final String CODE_PUSH_TAG = "CodePush";
5254
private final String DOWNLOAD_PROGRESS_EVENT_NAME = "CodePushDownloadProgress";
5355
private final String RESOURCES_BUNDLE = "resources.arsc";
5456

@@ -217,8 +219,9 @@ private JSONObject getPendingUpdate() {
217219
return pendingUpdate;
218220
} catch (JSONException e) {
219221
// Should not happen.
220-
throw new CodePushUnknownException("Unable to parse pending update metadata " +
222+
Log.e(CODE_PUSH_TAG, "Unable to parse pending update metadata " +
221223
pendingUpdateString + " stored in SharedPreferences", e);
224+
return null;
222225
}
223226
}
224227

0 commit comments

Comments
 (0)