Permalink
Browse files

Guard against `toString` returning null in TableDump

Fixes #1308.
  • Loading branch information...
szeiger committed Dec 10, 2015
1 parent 73a0166 commit d603f4bf9ff37b9b9f0d5d33591a79f740ca8fad
Showing with 2 additions and 1 deletion.
  1. +2 −1 slick/src/main/scala/slick/util/TableDump.scala
@@ -12,7 +12,8 @@ class TableDump(maxColumnWidth: Int = 20) {
protected[this] val spaces = Iterator.fill(maxColumnWidth+2)(' ').mkString
protected[this] def formatLine(line: IndexedSeq[Any]): IndexedSeq[String] = line.map { v =>
(if(v == null) "NULL" else v.toString).replace("\r", "\\r").replace("\n", "\\n").replace("\t", "\\t")
val s = if(v == null) "NULL" else v.toString
if(s == null) "NULL" else s.replace("\r", "\\r").replace("\n", "\\n").replace("\t", "\\t")
}
def apply(headers: IndexedSeq[IndexedSeq[String]], data: IndexedSeq[IndexedSeq[Any]]): IndexedSeq[String] = {

0 comments on commit d603f4b

Please sign in to comment.