diff --git a/websocket-sharp/WebSocketFrame.cs b/websocket-sharp/WebSocketFrame.cs index 1bc9f6d1..dc577dc3 100644 --- a/websocket-sharp/WebSocketFrame.cs +++ b/websocket-sharp/WebSocketFrame.cs @@ -518,7 +518,8 @@ Extended Payload Length: {7} Stream stream, WebSocketFrame frame, Action completed, - Action error) + Action error + ) { var len = frame.ExtendedPayloadLengthCount; if (len == 0) { @@ -531,14 +532,16 @@ Extended Payload Length: {7} stream.ReadBytesAsync ( len, bytes => { - if (bytes.Length != len) - throw new WebSocketException ( - "The extended payload length of a frame cannot be read from the stream."); + if (bytes.Length != len) { + var msg = "The extended payload length of a frame could not be read."; + throw new WebSocketException (msg); + } frame._extPayloadLength = bytes; completed (frame); }, - error); + error + ); } private static WebSocketFrame readHeader (Stream stream)