From ce259c126aaab66ddbd8f5483c9fd0e228df9aa8 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 20 Mar 2017 14:30:53 -0700 Subject: [PATCH] communicator/ssh: fix nil ptr error fixes a case where we could return a nil error and nil ssh session. --- communicator/ssh/communicator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index b32ad3ea7..e3082bac1 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -239,9 +239,9 @@ func (c *comm) newSession() (session *ssh.Session, err error) { } if c.client == nil { - err = errors.New("client not available") + return nil, errors.New("client not available") } else { - session, err = c.client.NewSession() + return c.client.NewSession() } }