Skip to content

Commit

Permalink
Merge pull request #1294 from hashicorp/b-task-runner-panic
Browse files Browse the repository at this point in the history
Guard against restoring a nil task in task_runner
  • Loading branch information
dadgar committed Jun 16, 2016
2 parents d1df351 + 041e6eb commit eb9a986
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client/task_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,13 @@ func (r *TaskRunner) RestoreState() error {
}

// Restore fields
r.task = snap.Task
if snap.Task == nil {
err := fmt.Errorf("task runner snapshot include nil Task")
r.logger.Printf("[ERR] client: %v", err)
return err
} else {
r.task = snap.Task
}
r.artifactsDownloaded = snap.ArtifactDownloaded

if err := r.setTaskEnv(); err != nil {
Expand Down

0 comments on commit eb9a986

Please sign in to comment.