Fix NullPointerException in appendLog

This commit is contained in:
Eugene Yokota 2020-06-14 17:28:49 -04:00
parent 3c5b88a83a
commit 64335567ac
1 changed files with 17 additions and 13 deletions

View File

@ -484,6 +484,9 @@ trait Appender extends AutoCloseable {
message: String
): Unit =
try {
// according to https://github.com/sbt/sbt/issues/5608, sometimes we get a null message
if (message == null) ()
else {
val len =
labelColor.length + label.length + messageColor.length + reset.length * 3 + ClearScreenAfterCursor.length
val builder: StringBuilder = new StringBuilder(len)
@ -500,6 +503,7 @@ trait Appender extends AutoCloseable {
builder.append(ClearScreenAfterCursor)
write(builder.toString)
}
}
} catch { case _: InterruptedException => }
// success is called by ConsoleLogger.