From 73574afb71deb3f2126ff53bf0a8279fc5b7f2fa Mon Sep 17 00:00:00 2001 From: "April P." Date: Sun, 29 Dec 2024 05:33:27 -0800 Subject: [PATCH] Wrap location ID parsing in a try/catch block --- MistWX-i2Me/Program.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/MistWX-i2Me/Program.cs b/MistWX-i2Me/Program.cs index 73663e4..b9de8f6 100644 --- a/MistWX-i2Me/Program.cs +++ b/MistWX-i2Me/Program.cs @@ -1,4 +1,5 @@ -using System.Xml.Serialization; +using System.Data.SQLite; +using System.Xml.Serialization; using MistWX_i2Me; using MistWX_i2Me.API; using MistWX_i2Me.API.Products; @@ -125,10 +126,18 @@ public class Program { continue; } - - string choppedValue = i.Value.ToString().Split("1_US_")[1]; - locations.Add(choppedValue); - + + + try + { + string choppedValue = i.Value.ToString().Split("1_US_")[1]; + + locations.Add(choppedValue); + } + catch (Exception ex) + { + continue; + } } }