Skip to content

Commit

Permalink
add NPE guard
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingCat committed Nov 22, 2014
1 parent 21b6840 commit 1e9e14d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,6 @@ class DAGScheduler(
}
event.reason match {
case Success =>
// only save AccumulatorValue when it's the first successfully finished
// task
if (event.accumUpdates != null) {
try {
event.accumUpdates.foreach { case (id, partialValue) =>
Expand Down Expand Up @@ -970,7 +968,9 @@ class DAGScheduler(
stage.resultOfJob match {
case Some(job) =>
if (!job.finished(rt.outputId)) {
Accumulators.add(event.accumUpdates)
if (event.accumUpdates != null) {
Accumulators.add(event.accumUpdates)
}
job.finished(rt.outputId) = true
job.numFinished += 1
// If the whole job has finished, remove it
Expand Down

0 comments on commit 1e9e14d

Please sign in to comment.