Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e24fa31

Browse files
committed
Harden DisplayReporter against null messages
1 parent 874bf03 commit e24fa31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/scala/tools/nsc/reporters/DisplayReporter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ object DisplayReporter {
107107

108108
/** Split a message into a prefix and an optional explanation that follows a line starting with `"----"`. */
109109
private def splitting(msg: String, explaining: Boolean): String =
110-
if (msg.indexOf("\n----") > 0) {
110+
if (msg != null && msg.indexOf("\n----") > 0) {
111111
val (err, exp) = msg.lines.span(!_.startsWith("----"))
112112
if (explaining) (err ++ exp.drop(1)).mkString("\n") else err.mkString("\n")
113113
} else {

0 commit comments

Comments
 (0)