mirror of
https://github.com/gravitational/teleport
synced 2024-10-21 01:34:01 +00:00
Prevent nil pointer panic on node shutdown
If node hasn't fully initialized before getting stopped (such as when join token isn't valid), most pointer vars in `initSSH` will be nil. Handle that cleanly.
This commit is contained in:
parent
a7d9a03a09
commit
64b11dd5ab
|
@ -1588,12 +1588,14 @@ func (process *TeleportProcess) initSSH() error {
|
|||
warnOnErr(s.Shutdown(payloadContext(payload)))
|
||||
}
|
||||
}
|
||||
if conn.UseTunnel() {
|
||||
if conn != nil && conn.UseTunnel() {
|
||||
agentPool.Stop()
|
||||
}
|
||||
|
||||
// Close BPF service.
|
||||
warnOnErr(ebpf.Close())
|
||||
if ebpf != nil {
|
||||
// Close BPF service.
|
||||
warnOnErr(ebpf.Close())
|
||||
}
|
||||
|
||||
log.Infof("Exited.")
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue