From f7eecfc1313d0fb07d06fdb0333b775f4660d67f Mon Sep 17 00:00:00 2001 From: Mikhail Khludnev Date: Thu, 14 Nov 2024 09:40:56 +0300 Subject: [PATCH] asserts Signed-off-by: mikhail-khludnev --- .../main/java/org/opensearch/index/mapper/IpFieldMapper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java index 8336b09bdb818..49e5d104ab310 100644 --- a/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java @@ -257,11 +257,15 @@ public Query termQuery(Object value, @Nullable QueryShardContext context) { private Query indexOrDvQuery(Query pointQuery, Query dvQuery) { if (isSearchable() && hasDocValues()) { + assert pointQuery!=null; + assert dvQuery!=null; return new IndexOrDocValuesQuery(pointQuery, dvQuery); } else { if (isSearchable()) { + assert pointQuery!=null; return pointQuery; } else { + assert dvQuery!=null; return dvQuery; } }