From 6bb744abf5e2b05415267d1751e66de0b10deece Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 15 Oct 2018 19:48:16 +0900 Subject: [PATCH] [Modify] Throw ArgumentOutOfRangeException --- websocket-sharp/Net/HttpUtility.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; }