Skip to content

Commit d3dbaf5

Browse files
marmbrusrxin
authored andcommitted
Fix possible null pointer in acumulator toString
Author: Michael Armbrust <michael@databricks.com> Closes #1204 from marmbrus/nullPointerToString and squashes the following commits: 35b5fce [Michael Armbrust] Fix possible null pointer in acumulator toString (cherry picked from commit 2714968) Signed-off-by: Reynold Xin <rxin@apache.org>
1 parent e199a02 commit d3dbaf5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/Accumulators.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class Accumulable[R, T] (
127127
Accumulators.register(this, false)
128128
}
129129

130-
override def toString = value_.toString
130+
override def toString = if (value_ == null) "null" else value_.toString
131131
}
132132

133133
/**

0 commit comments

Comments
 (0)