From def38ed52d1aac43241741e6691a4ae3ea9ac64c Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 19 Oct 2018 19:38:43 +0900 Subject: [PATCH] [Modify] Throw exception --- websocket-sharp/Net/HttpUtility.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index 4c2f5e17..35ed58eb 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -1133,12 +1133,13 @@ namespace WebSocketSharp.Net public static string UrlDecode (byte[] bytes, Encoding encoding) { - int len; - return bytes == null - ? null - : (len = bytes.Length) == 0 - ? String.Empty - : InternalUrlDecode (bytes, 0, len, encoding ?? Encoding.UTF8); + if (bytes == null) + throw new ArgumentNullException ("bytes"); + + var len = bytes.Length; + return len > 0 + ? InternalUrlDecode (bytes, 0, len, encoding ?? Encoding.UTF8) + : String.Empty; } public static string UrlDecode (