mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-14 10:44:28 +01:00
Ignoring prefs cookie deserialization errors
This commit is contained in:
@@ -43,7 +43,13 @@ namespace BTCPayServer.Controllers.Logic
|
||||
var prefCookie = new UserPrefsCookie();
|
||||
ctrl.Request.Cookies.TryGetValue(nameof(UserPrefsCookie), out var strPrefCookie);
|
||||
if (!String.IsNullOrEmpty(strPrefCookie))
|
||||
prefCookie = JsonConvert.DeserializeObject<UserPrefsCookie>(strPrefCookie);
|
||||
{
|
||||
try
|
||||
{
|
||||
prefCookie = JsonConvert.DeserializeObject<UserPrefsCookie>(strPrefCookie);
|
||||
}
|
||||
catch { /* ignore cookie deserialization failures */ }
|
||||
}
|
||||
|
||||
return prefCookie;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user