[Modify] Throw ArgumentOutOfRangeException
This commit is contained in:
parent
fdec698273
commit
3a82d30921
@ -1299,8 +1299,11 @@ namespace WebSocketSharp.Net
|
|||||||
|
|
||||||
var len = bytes.Length;
|
var len = bytes.Length;
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
if (offset != 0 || count != 0)
|
if (offset != 0)
|
||||||
throw new ArgumentException ("An empty byte array.", "bytes");
|
throw new ArgumentOutOfRangeException ("offset");
|
||||||
|
|
||||||
|
if (count != 0)
|
||||||
|
throw new ArgumentOutOfRangeException ("count");
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user