#504 fix potential NPE in StreamEncoder (char-array can be null)

This commit is contained in:
Andreas Gudian 2015-03-17 13:52:12 +01:00
parent 0674a8780b
commit fb8a6e3ae0

View File

@ -143,6 +143,7 @@ class IndentationCorrectingWriter extends Writer {
}
private void flush(StateContext context) throws IOException {
if ( null != context.characters && context.currentIndex - context.lastStateChange > 0 ) {
context.writer.write(
context.characters,
context.lastStateChange,
@ -161,6 +162,7 @@ class IndentationCorrectingWriter extends Writer {
);
}
}
}
},
/**