diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index bc4d0f40b..289543495 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -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