SOLR-14516: NPE in JsonTextWriter

This commit is contained in:
noble 2020-06-15 19:17:23 +10:00
parent 8426dc7a6a
commit fabc704748
2 changed files with 7 additions and 0 deletions

View File

@ -239,6 +239,8 @@ Bug Fixes
* SOLR-14345: Return proper error message when non-BinaryResponseParser is used in solrJ (Munendra S N)
* SOLR-14516: NPE in JsonTextWriter (noble)
Other Changes
---------------------
* SOLR-14197: SolrResourceLoader: marked many methods as deprecated, and in some cases rerouted exiting logic to avoid

View File

@ -67,6 +67,11 @@ public interface JsonTextWriter extends TextWriter {
}
default void writeStr(String name, String val, boolean needsEscaping) throws IOException {
if (val == null) {
writeNull(name);
return;
}
// it might be more efficient to use a stringbuilder or write substrings
// if writing chars to the stream is slow.
if (needsEscaping) {