diff --git a/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java b/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java index 6ba6c30c26f..6aae64c4b0d 100644 --- a/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java +++ b/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java @@ -849,6 +849,9 @@ public final class XContentBuilder { } public XContentBuilder value(Boolean value) throws IOException { + if (value == null) { + return nullValue(); + } return value(value.booleanValue()); }