diff --git a/websocket-sharp/Net/HttpConnection.cs b/websocket-sharp/Net/HttpConnection.cs index 5ad2763f..de78400e 100644 --- a/websocket-sharp/Net/HttpConnection.cs +++ b/websocket-sharp/Net/HttpConnection.cs @@ -538,11 +538,11 @@ namespace WebSocketSharp.Net { // TODO: Can we get this stream before reading the input? - if (_outputStream != null || _socket == null) - return _outputStream; - lock (_sync) { if (_socket == null) + return null; + + if (_outputStream != null) return _outputStream; var lsnr = _context.Listener;