Don't check and throw exception in a display function. We should check this at input side.

This commit is contained in:
noisyfox
2016-12-15 16:51:23 +11:00
parent 0c055caffd
commit f66638d14c
+1 -3
View File
@@ -45,9 +45,7 @@ namespace Shadowsocks.Model
string serverStr;
// CheckHostName() won't do a real DNS lookup
var hostType = Uri.CheckHostName( server );
if ( hostType == UriHostNameType.Unknown ) {
throw new FormatException("Invalid Server Address.");
}
switch ( hostType ) {
case UriHostNameType.IPv6:
serverStr = $"[{server}]:{server_port}";