[Modify] Use the try method
This commit is contained in:
parent
74b79c1a39
commit
9209f4c416
@ -290,7 +290,14 @@ namespace WebSocketSharp.Net
|
||||
: String.Empty;
|
||||
|
||||
if (name.Equals ("$version", caseInsensitive)) {
|
||||
ver = val.Length > 0 ? Int32.Parse (val.Unquote ()) : 0;
|
||||
if (val.Length == 0)
|
||||
continue;
|
||||
|
||||
int num;
|
||||
if (!Int32.TryParse (val.Unquote (), out num))
|
||||
continue;
|
||||
|
||||
ver = num;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user