mirror of https://github.com/apache/lucene.git
handle null key for json.nl=flat
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@503795 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
24d527bb51
commit
64166984f6
|
@ -254,7 +254,6 @@ class JSONWriter extends TextResponseWriter {
|
|||
// NamedList("a"=1,"b"=2,null=3) => ["a",1,"b",2,null,3]
|
||||
protected void writeNamedListAsFlat(String name, NamedList val) throws IOException {
|
||||
int sz = val.size();
|
||||
indent();
|
||||
writer.write('[');
|
||||
incLevel();
|
||||
|
||||
|
@ -264,7 +263,11 @@ class JSONWriter extends TextResponseWriter {
|
|||
}
|
||||
String key = val.getName(i);
|
||||
indent();
|
||||
writeStr(null, key, true);
|
||||
if (key==null) {
|
||||
writeNull(null);
|
||||
} else {
|
||||
writeStr(null, key, true);
|
||||
}
|
||||
writer.write(',');
|
||||
writeVal(key, val.getVal(i));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue