NullPointerException when asking for null valued json field when fetching search request, closes #1749.
This commit is contained in:
parent
078f220b6f
commit
1f6f81d840
|
@ -146,6 +146,10 @@ public class XContentMapConverter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void writeValue(XContentGenerator gen, Object value) throws IOException {
|
private static void writeValue(XContentGenerator gen, Object value) throws IOException {
|
||||||
|
if (value == null) {
|
||||||
|
gen.writeNull();
|
||||||
|
return;
|
||||||
|
}
|
||||||
Class type = value.getClass();
|
Class type = value.getClass();
|
||||||
if (type == String.class) {
|
if (type == String.class) {
|
||||||
gen.writeString((String) value);
|
gen.writeString((String) value);
|
||||||
|
|
Loading…
Reference in New Issue