Fixed method

This commit is contained in:
Luca Frosini 2023-04-21 17:01:22 +02:00
parent 010e62f4fa
commit 941b47eb14
1 changed files with 4 additions and 1 deletions

View File

@ -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{