Skip to content

Commit

Permalink
Merge pull request #308 from holashchand/release-1.0.0-issue-1001
Browse files Browse the repository at this point in the history
[BUG]: Fixed APIs failure when some private fields are not required with enc…
  • Loading branch information
challabeehyv authored Jun 4, 2024
2 parents b867336 + ec5fea1 commit 0410ef3
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -39,8 +40,11 @@ public Map<String, Object> getPrivateFields(JsonNode rootNode, List<String> 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;
Expand Down

0 comments on commit 0410ef3

Please sign in to comment.