diff --git a/command/agent/agent.go b/command/agent/agent.go index 286e0a6ac..3af539e4c 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -1011,8 +1011,11 @@ func (a *Agent) Shutdown() error { chk.Stop() } - err := a.delegate.Shutdown() - a.logger.Print("[DEBUG] agent: delegate down") + var err error + if a.delegate != nil { + err = a.delegate.Shutdown() + a.logger.Print("[DEBUG] agent: delegate down") + } pidErr := a.deletePid() if pidErr != nil {