From 77bf91cfbe118944584b3010dc63216e8eb48227 Mon Sep 17 00:00:00 2001 From: sta Date: Thu, 30 May 2019 19:58:31 +0900 Subject: [PATCH] [Modify] Use the try method --- websocket-sharp/Net/CookieCollection.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/websocket-sharp/Net/CookieCollection.cs b/websocket-sharp/Net/CookieCollection.cs index 8ebfb48c..6a9499d8 100644 --- a/websocket-sharp/Net/CookieCollection.cs +++ b/websocket-sharp/Net/CookieCollection.cs @@ -462,7 +462,11 @@ namespace WebSocketSharp.Net if (val.Length == 0) continue; - cookie.MaxAge = Int32.Parse (val.Unquote ()); + int num; + if (!Int32.TryParse (val.Unquote (), out num)) + continue; + + cookie.MaxAge = num; continue; }