[Modify] Throw ArgumentOutOfRangeException

This commit is contained in:
sta 2018-10-16 19:37:45 +09:00
parent 6bb744abf5
commit fdec698273

View File

@ -1234,8 +1234,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 String.Empty;
}