From 52f3686356225fa877e71c208d600a7af5e728d2 Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Tue, 13 Aug 2024 15:56:04 +1000 Subject: [PATCH] AUS-4228 Prevent CSW merge creating empty coords --- .../org/auscope/portal/core/services/CSWCacheService.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/auscope/portal/core/services/CSWCacheService.java b/src/main/java/org/auscope/portal/core/services/CSWCacheService.java index 042638806..22cce134e 100644 --- a/src/main/java/org/auscope/portal/core/services/CSWCacheService.java +++ b/src/main/java/org/auscope/portal/core/services/CSWCacheService.java @@ -549,9 +549,11 @@ private void mergeRecords(CSWServiceItem cswService, CSWRecord destination, CSWR } } } - CSWGeographicElement geoElemArr[] = new CSWGeographicElement[geoElemSet.size()]; - geoElemSet.toArray(geoElemArr); - destination.setCSWGeographicElements(geoElemArr); + if (geoElemSet.size() > 0) { + CSWGeographicElement geoElemArr[] = new CSWGeographicElement[geoElemSet.size()]; + geoElemSet.toArray(geoElemArr); + destination.setCSWGeographicElements(geoElemArr); + } // Merge constraints, accessConstraints and useLimitConstraints (no dupes) Set constraintSet = new HashSet<>();