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
6a40fe026e
commit
449eceec11
|
@ -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