Skip to content

Commit 0a1b70d

Browse files
Christoph BauerChristoph Bauer
authored andcommitted
Add extra null check in StreamEngine
1 parent f127b80 commit 0a1b70d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/NetMQ/Core/Transports/StreamEngine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ private void Error()
323323
m_state = State.Error;
324324
m_socket.EventDisconnected(m_endpoint, m_handle);
325325
m_session.Flush();
326-
m_session.Detach(m_state != State.Handshaking && m_mechanism.Status != MechanismStatus.Handshaking );
326+
m_session.Detach(m_state != State.Handshaking && (m_mechanism is null || m_mechanism.Status != MechanismStatus.Handshaking) );
327327
Unplug();
328328
Destroy();
329329
}

0 commit comments

Comments
 (0)