File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
server/src/main/java/org/elasticsearch/index/mapper Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -568,6 +568,7 @@ protected String contentType() {
568568 protected void parseCreateField (DocumentParserContext context ) throws IOException {
569569 InetAddress address ;
570570 String value = context .parser ().textOrNull ();
571+ boolean isNotNull = value != null || nullValue != null ;
571572 try {
572573 address = value == null ? nullValue : InetAddresses .forString (value );
573574 } catch (IllegalArgumentException e ) {
@@ -582,11 +583,11 @@ protected void parseCreateField(DocumentParserContext context) throws IOExceptio
582583 throw e ;
583584 }
584585 }
585- if (address != null ) {
586+ if (isNotNull ) {
586587 indexValue (context , address );
587588 }
588589 if (offsetsFieldName != null && context .isImmediateParentAnArray () && context .canAddIgnoredField ()) {
589- if (address != null ) {
590+ if (isNotNull ) {
590591 BytesRef sortableValue = new BytesRef (InetAddressPoint .encode (address ));
591592 context .getOffSetContext ().recordOffset (offsetsFieldName , sortableValue );
592593 } else {
You can’t perform that action at this time.
0 commit comments