[Modify] Throw ArgumentOutOfRangeException

This commit is contained in:
sta 2018-10-17 19:35:42 +09:00
parent fdec698273
commit 3a82d30921

View File

@ -1299,8 +1299,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;
}