diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index 584818c5..b859fab3 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -1194,8 +1194,11 @@ namespace WebSocketSharp.Net var len = bytes.Length; if (len == 0) { - if (offset != 0 || count != 0) - throw new ArgumentException ("An empty byte array.", "bytes"); + if (offset != 0) + throw new ArgumentOutOfRangeException ("offset"); + + if (count != 0) + throw new ArgumentOutOfRangeException ("count"); return bytes; }