NullPointerException when asking for null valued json field when fetching search request, closes #1749.

This commit is contained in:
Shay Banon 2012-02-29 16:43:30 +02:00
parent 078f220b6f
commit 1f6f81d840
1 changed files with 4 additions and 0 deletions

View File

@ -146,6 +146,10 @@ public class XContentMapConverter {
}
private static void writeValue(XContentGenerator gen, Object value) throws IOException {
if (value == null) {
gen.writeNull();
return;
}
Class type = value.getClass();
if (type == String.class) {
gen.writeString((String) value);