Fix NullPointerException in writeln() introduced in previous commit.

This commit is contained in:
hns 2003-08-18 11:13:39 +00:00
parent 2014f13cfd
commit 3be7e4db54

View file

@ -246,7 +246,13 @@ public final class ResponseTrans implements Externalizable {
* Utility function that appends a <br> to whatever is written.
*/
public void writeln(Object what) {
this.write(what);
write(what);
// if what is null, buffer may still be uninitialized
if (buffer == null) {
buffer = new StringBuffer(INITIAL_BUFFER_SIZE);
}
buffer.append("<br />");
buffer.append(newLine);
}