the string can be null, for example failed assertions getMessage(), dont throw NPE

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1042359 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2010-12-05 14:24:02 +00:00
parent 995abebdec
commit 4e44804c38
1 changed files with 2 additions and 0 deletions

View File

@ -263,6 +263,8 @@ public class LuceneJUnitResultFormatter implements JUnitResultFormatter {
}
public LuceneJUnitResultFormatter append(String s) {
if (s == null)
s = "(null)";
try {
sb.write(s.getBytes()); // intentionally use default charset, its a console.
} catch (IOException e) {