use snap.Alloc.TaskStates only after confirming snap.Alloc is not nil
This commit is contained in:
parent
46893c7558
commit
2c864172eb
|
@ -122,7 +122,6 @@ func (r *AllocRunner) RestoreState() error {
|
|||
r.ctx = snap.Context
|
||||
r.allocClientStatus = snap.AllocClientStatus
|
||||
r.allocClientDescription = snap.AllocClientDescription
|
||||
r.taskStates = snap.Alloc.TaskStates
|
||||
|
||||
var snapshotErrors multierror.Error
|
||||
if r.alloc == nil {
|
||||
|
@ -135,6 +134,8 @@ func (r *AllocRunner) RestoreState() error {
|
|||
return e
|
||||
}
|
||||
|
||||
r.taskStates = snap.Alloc.TaskStates
|
||||
|
||||
// Restore the task runners
|
||||
var mErr multierror.Error
|
||||
for name, state := range r.taskStates {
|
||||
|
|
Loading…
Reference in a new issue