mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-21 15:31:41 -04:00
Merge pull request #4008 from mitchellh/fix3699
prevent panic when ssh reconnect fails
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user