From 009d2dc887010e3d08b61921e973d3fc15540625 Mon Sep 17 00:00:00 2001 From: JiglioNero Date: Mon, 10 Jun 2024 18:19:29 +0200 Subject: [PATCH] Handle null values in CodePushUtils.java --- .../main/java/com/microsoft/codepush/react/CodePushUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java b/android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java index eb099bd9e..b0eb0c4d9 100644 --- a/android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java +++ b/android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java @@ -67,7 +67,9 @@ public static WritableMap convertJsonObjectToWritable(JSONObject jsonObj) { String key = it.next(); Object obj = null; try { - obj = jsonObj.get(key); + if (!jsonObj.isNull(key)) { + obj = jsonObj.get(key); + } } catch (JSONException jsonException) { // Should not happen. throw new CodePushUnknownException("Key " + key + " should exist in " + jsonObj.toString() + ".", jsonException);