diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/util/PrivateField.java b/java/registry/src/main/java/dev/sunbirdrc/registry/util/PrivateField.java index 9b2b8f534..b8413e480 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/util/PrivateField.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/util/PrivateField.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.jayway.jsonpath.DocumentContext; import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.PathNotFoundException; import dev.sunbirdrc.registry.exception.EncryptionException; import dev.sunbirdrc.registry.middleware.util.Constants; import dev.sunbirdrc.registry.middleware.util.JSONUtil; @@ -39,8 +40,11 @@ public Map getPrivateFields(JsonNode rootNode, List priv if(privatePropertyLst != null) { DocumentContext documentContext = JsonPath.parse(rootNode.toString()); privatePropertyLst.forEach(path -> { - Object read = documentContext.read(path); - plainKeyValues.put(path, read); + try { + Object read = documentContext.read(path); + plainKeyValues.put(path, read); + } catch (PathNotFoundException ignored) { + } }); } return plainKeyValues;