diff --git a/scheduler/generic_sched.go b/scheduler/generic_sched.go index e4b27b64e..03b35b943 100644 --- a/scheduler/generic_sched.go +++ b/scheduler/generic_sched.go @@ -517,7 +517,7 @@ func (s *GenericScheduler) computePlacements(destructive, place []placementResul // If we are placing a canary and we found a match, add the canary // to the deployment state object and mark it as a canary. - if missing.Canary() { + if missing.Canary() && s.deployment != nil { if state, ok := s.deployment.TaskGroups[tg.Name]; ok { state.PlacedCanaries = append(state.PlacedCanaries, alloc.ID) }