From 941b47eb142e450f17cb9c70217d0cc6500278ae Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 21 Apr 2023 17:01:22 +0200 Subject: [PATCH] Fixed method --- .../java/org/gcube/informationsystem/utils/TypeUtility.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/gcube/informationsystem/utils/TypeUtility.java b/src/main/java/org/gcube/informationsystem/utils/TypeUtility.java index 8ad8f00..474c095 100644 --- a/src/main/java/org/gcube/informationsystem/utils/TypeUtility.java +++ b/src/main/java/org/gcube/informationsystem/utils/TypeUtility.java @@ -13,7 +13,10 @@ import org.gcube.informationsystem.types.TypeMapper; public class TypeUtility { public static String getTypeName(JsonNode jsonNode){ - return jsonNode.get(Element.CLASS_PROPERTY).asText(); + if(jsonNode.has(Element.CLASS_PROPERTY)) { + return jsonNode.get(Element.CLASS_PROPERTY).asText(); + } + return null; } public static String getTypeName(String json) throws JsonProcessingException, IOException{