From 3a82d3092158aad74e7801b9e3d4b14957ac4fa0 Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 17 Oct 2018 19:35:42 +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 94b1946b..e19eb6ab 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -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; }