From ad07810610c1f2598fc0995b2ad3b4f0f7ae8edd Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Wed, 11 Apr 2012 20:54:14 +0300 Subject: [PATCH] XContentBuilder throws NPE on null Boolean, closes #1853. --- .../org/elasticsearch/common/xcontent/XContentBuilder.java | 3 +++ 1 file changed, 3 insertions(+) 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()); }