Skip to content

Commit

Permalink
Fix json array reading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rahmanusta committed Jul 5, 2024
1 parent 172dc33 commit 551c1b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/kodedu/other/JsonHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 551c1b3

Please sign in to comment.