From 0aa1a544f73af8c9506a1b4aa21ddef50a6772fe Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 21 Sep 2018 19:40:49 +0900 Subject: [PATCH] [Modify] Throw exception --- websocket-sharp/Net/HttpUtility.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index 3859598b..14c20206 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -1296,11 +1296,12 @@ namespace WebSocketSharp.Net public static byte[] UrlEncodeUnicodeToBytes (string s) { - return s == null - ? null - : s.Length == 0 - ? new byte[0] - : InternalUrlEncodeUnicodeToBytes (s); + if (s == null) + throw new ArgumentNullException ("s"); + + return s.Length > 0 + ? InternalUrlEncodeUnicodeToBytes (s) + : new byte[0]; } public static string UrlPathEncode (string s)