Skip to content

Commit b9ade05

Browse files
author
Scott Tadman
committed
Avoid throwing exception when attempting to shutdown a non-open connection
1 parent 1224432 commit b9ade05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/net/sftp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def self.start(host, user, options={}, &block)
4040
sftp
4141
rescue Object => anything
4242
begin
43-
session.shutdown!
43+
session and session.shutdown!
4444
rescue Exception
4545
# swallow exceptions that occur while trying to shutdown
4646
end

0 commit comments

Comments
 (0)