Fix JSON ParseError exporting settings if custom settings have never been edited.
This commit is contained in:
parent
7c6b64c13e
commit
219f407246
@ -508,7 +508,13 @@ namespace smx_config
|
||||
|
||||
static public List<object> GetCustomSensorsJSON()
|
||||
{
|
||||
try {
|
||||
return SMXJSON.ParseJSON.Parse<List<object>>(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<object>();
|
||||
}
|
||||
}
|
||||
|
||||
const int SensorLeft = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user