From 57306bfc9e4dce061b113754aba87fc0eda91ab5 Mon Sep 17 00:00:00 2001 From: zane-neo Date: Tue, 4 Jun 2024 09:04:09 +0800 Subject: [PATCH] Update src/main/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtils.java Co-authored-by: Martin Gaievski Signed-off-by: zane-neo --- .../opensearch/neuralsearch/util/ProcessorDocumentUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtils.java b/src/main/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtils.java index fbaad628e..426af38ee 100644 --- a/src/main/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtils.java +++ b/src/main/java/org/opensearch/neuralsearch/util/ProcessorDocumentUtils.java @@ -58,7 +58,10 @@ private static void validateMapTypeValue( final Environment environment, final boolean allowEmpty ) { - if (sourceValue == null) return; // allow map type value to be null. + // allow map type value to be null + if (Objects.isNull(sourceValue) { + return; + } validateDepth(sourceKey, depth, indexName, clusterService, environment); if (!(fieldMap instanceof Map)) { // source value is map type means configuration has to be map type throw new IllegalArgumentException(