Merge pull request #4008 from mitchellh/fix3699

prevent panic when ssh reconnect fails
This commit is contained in:
Matthew Hooker 2016-10-14 15:50:49 -07:00 committed by GitHub
commit 1eb042bbf5
1 changed files with 5 additions and 1 deletions

View File

@ -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