mirror of https://github.com/status-im/consul.git
agent: shutdown delegate if created
When the TestAgent shuts down a half-started agent the delegate may not have been created at this point.
This commit is contained in:
parent
632f837c98
commit
e16589c079
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue