Skip to content

Commit

Permalink
fix NPE in teamcity reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
mutcianm committed Aug 30, 2016
1 parent ab74494 commit dfc9c7d
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -49,8 +49,8 @@ trait AllProjectHighlightingTest {

override def reportError(file: VirtualFile, range: TextRange, message: String): Unit = {
totalErrors += 1
val escaped = escapeTC(message)
val testName = s"${getClass.getName}.${file.getName}$range"
val escaped = escapeTC(Option(message).getOrElse(""))
val testName = s"${getClass.getName}.${Option(file).map(_.getName).getOrElse("UNKNOWN")}${Option(range).map(_.toString).getOrElse("(UNKNOWN)")}"
println(s"##teamcity[testStarted name='$testName']")
println(s"##teamcity[testFailed name='$testName' message='Highlighting error' details='$escaped']")
println(s"##teamcity[testFinished name='$testName']")
Expand Down

0 comments on commit dfc9c7d

Please sign in to comment.