From 551c1b3ae7b7cc728ff0a4ddb434233be950feff Mon Sep 17 00:00:00 2001 From: Rahman Usta Date: Fri, 5 Jul 2024 22:32:49 +0200 Subject: [PATCH] Fix json array reading issue --- src/main/java/com/kodedu/other/JsonHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/kodedu/other/JsonHelper.java b/src/main/java/com/kodedu/other/JsonHelper.java index 4d5d3131..923dc7b7 100644 --- a/src/main/java/com/kodedu/other/JsonHelper.java +++ b/src/main/java/com/kodedu/other/JsonHelper.java @@ -7,7 +7,7 @@ public class JsonHelper { public static JsonArray getJsonArrayOrEmpty(JsonObject jsonObject, String key) { - if (jsonObject.containsKey(key) && jsonObject.getValueType() == JsonValue.ValueType.ARRAY) { + if (jsonObject.containsKey(key) && jsonObject.get(key).getValueType() == JsonValue.ValueType.ARRAY) { return jsonObject.getJsonArray(key); } return JsonValue.EMPTY_JSON_ARRAY;