Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
Fix NullPointerException when message field is a null (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
borkaehw authored Aug 5, 2019
1 parent 584e319 commit a0812a2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import scala.collection.mutable.ListBuffer
import scala.xml.{Elem, XML}

class JUnitXmlReporter(tasksAndEvents: ListBuffer[(String, ListBuffer[Event])]) {
private def escape(str: String): String =
str.replaceAll("&", "&amp;").replaceAll("\"", "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
private def escape(info: String): String = info match {
case str: String =>
str.replaceAll("&", "&amp;").replaceAll("\"", "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;")
case _ => ""
}

def result: Elem =
XML.loadString(s"""<testsuites>
Expand Down

0 comments on commit a0812a2

Please sign in to comment.