Skip to content

Commit

Permalink
Ignoring close if TransportSSH is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniket Gawade committed Dec 1, 2020
1 parent 6bda392 commit 705e63a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions netconf/transport_ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ type TransportSSH struct {

// Close closes an existing SSH session and socket if they exist.
func (t *TransportSSH) Close() error {
// If TransportSSH is nil ignore closing ssh session
if t == nil {
return nil
}

// Close the SSH Session if we have one
if t.sshSession != nil {
if err := t.sshSession.Close(); err != nil {
Expand Down

0 comments on commit 705e63a

Please sign in to comment.