mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-11 01:30:06 -04:00
prevent panic when ssh reconnect fails
This commit is contained in:
parent
220709b7eb
commit
5747f4e890
1 changed files with 5 additions and 1 deletions
|
|
@ -240,7 +240,11 @@ func (c *comm) newSession() (session *ssh.Session, err error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return c.client.NewSession()
|
||||
if c.client == nil {
|
||||
err = errors.New("client not available")
|
||||
} else {
|
||||
session, err = c.client.NewSession()
|
||||
}
|
||||
}
|
||||
|
||||
return session, nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue