diff --git a/adapter/ohos/JsonUtil.java b/adapter/ohos/JsonUtil.java index fe5fdffc629ff583dfd3a40de3d3190931709218..928d6d8feffd9ac33dbd11f7dd4118bbfe0622da 100644 --- a/adapter/ohos/JsonUtil.java +++ b/adapter/ohos/JsonUtil.java @@ -2034,6 +2034,10 @@ public class JsonUtil { */ private static int getJsonIntValue(JSONObject jsonObject, String key) { int value = 0; + if (jsonObject == null) { + LOG.error("Error: getJsonIntValue: jsonObject is null"); + throw new BundleException("getJsonIntValue failed, jsonObject is null"); + } if (jsonObject != null && jsonObject.containsKey(key)) { value = jsonObject.getIntValue(key); }