[Modify] Add an empty check

This commit is contained in:
sta 2020-11-26 20:14:50 +09:00
parent 710465a9e9
commit 587bf34c18

View File

@ -82,6 +82,9 @@ namespace WebSocketSharp.Net
if (targetHost == null) if (targetHost == null)
throw new ArgumentNullException ("targetHost"); throw new ArgumentNullException ("targetHost");
if (targetHost.Length == 0)
throw new ArgumentException ("An empty string.", "targetHost");
_targetHost = targetHost; _targetHost = targetHost;
_enabledSslProtocols = SslProtocols.None; _enabledSslProtocols = SslProtocols.None;