diff --git a/smx-config/Helpers.cs b/smx-config/Helpers.cs index 7ac0f6d..99b9900 100644 --- a/smx-config/Helpers.cs +++ b/smx-config/Helpers.cs @@ -508,7 +508,13 @@ namespace smx_config static public List GetCustomSensorsJSON() { - return SMXJSON.ParseJSON.Parse>(Properties.Settings.Default.CustomSensors); + try { + return SMXJSON.ParseJSON.Parse>(Properties.Settings.Default.CustomSensors); + } catch(ParseError) { + // CustomSensors is empty by default. We could test if it's empty, but as a more general + // safety, just catch any JSON errors in case something invalid is saved to it. + return new List(); + } } const int SensorLeft = 0;