Return empty list when node is an object
This commit is contained in:
parent
82ab70eaf9
commit
f4f44f61ff
@ -34,6 +34,9 @@ public class JsonNodeUtil {
|
|||||||
|
|
||||||
public static List<String> asStringList(JsonNode node) {
|
public static List<String> asStringList(JsonNode node) {
|
||||||
if(!(node instanceof ArrayNode)) {
|
if(!(node instanceof ArrayNode)) {
|
||||||
|
if (node.isObject()) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
return List.of(node.asText());
|
return List.of(node.asText());
|
||||||
} else {
|
} else {
|
||||||
ArrayNode arrayNode = (ArrayNode)node;
|
ArrayNode arrayNode = (ArrayNode)node;
|
||||||
|
Loading…
Reference in New Issue
Block a user