Skip to content

Commit 5db59fe

Browse files
committed
♻️ Always go into logout state in #disconnect
If `disconnected?` returns true, the connection state is most likely already `logout`. But, just in case, we'll ensure it's set every time.
1 parent d4b0b8f commit 5db59fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/net/imap.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,8 +1116,8 @@ def tls_verified?; @tls_verified end
11161116
#
11171117
# Related: #logout, #logout!
11181118
def disconnect
1119+
state_logout! unless connection_state.to_sym == :logout
11191120
return if disconnected?
1120-
state_logout!
11211121
begin
11221122
begin
11231123
# try to call SSL::SSLSocket#io.

0 commit comments

Comments
 (0)