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 4f8d81c2ca200..d30a282c57f45 100644 --- a/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java @@ -257,8 +257,7 @@ public Query termQuery(Object value, @Nullable QueryShardContext context) { private Query indexOrDvQuery(Query pointQuery, Query dvQuery) { if (isSearchable() && hasDocValues()) { - assert pointQuery != null; - assert dvQuery != null; + assert pointQuery != null && dvQuery != null; return new IndexOrDocValuesQuery(pointQuery, dvQuery); } else { if (isSearchable()) {