fix: prevent NPE when key-element is null

This commit is contained in:
Connor Tumbleson 2019-04-26 15:17:03 -04:00
parent f1357109aa
commit 6c17e1a14f

View File

@ -888,6 +888,13 @@ public class MXSerializer implements XmlSerializer {
protected void writeElementContent(String text, Writer out)
throws IOException {
// For some reason, some non-empty, empty characters are surviving this far and getting filtered out
// So we are left with null, which causes an NPE
if (text == null) {
return;
}
// escape '<', '&', ']]>', <32 if necessary
int pos = 0;
for (int i = 0; i < text.length(); i++) {