From 9cef29295094f701adff93047c6a1c0d774c35fa Mon Sep 17 00:00:00 2001 From: GeryNi Date: Wed, 23 Oct 2024 11:35:33 +0200 Subject: [PATCH] Added verification to avoid NullPointer exception in EsHTTPProxy. --- services/src/main/java/org/fao/geonet/api/es/EsHTTPProxy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/src/main/java/org/fao/geonet/api/es/EsHTTPProxy.java b/services/src/main/java/org/fao/geonet/api/es/EsHTTPProxy.java index caf3c9ea8ad..dbb861fe95f 100644 --- a/services/src/main/java/org/fao/geonet/api/es/EsHTTPProxy.java +++ b/services/src/main/java/org/fao/geonet/api/es/EsHTTPProxy.java @@ -690,7 +690,7 @@ private void processResponse(ServiceContext context, HttpSession httpSession, addRelatedTypes(doc, relatedTypes, context); } - if (doc.has("_source")) { + if (doc.has("_source") && doc.get("_source").has("documentStandard") ) { ObjectNode sourceNode = (ObjectNode) doc.get("_source"); String metadataSchema = doc.get("_source").get("documentStandard").asText();