[Modify] Throw ArgumentOutOfRangeException
This commit is contained in:
parent
90e5db72f2
commit
6bb744abf5
@ -1194,8 +1194,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