Set default value for digits per group if loaded invalid value

This commit is contained in:
Nathan McRae 2025-01-18 21:48:16 -08:00
parent 807e13d239
commit b32807de9e

View File

@ -134,6 +134,11 @@ public class MainController implements Initializable {
xmlMapper.writeValue(new File(filePath.toString()), settings);
} else {
settings = xmlMapper.readValue(new File(filePath.toString()), MainSettings.class);
for (StationSettings station : settings.getStations()) {
if (station.getDigitsPerGroup() == 0) {
station.setDigitsPerGroup(4);
}
}
}
} catch (IOException e) {
// Print the contents of filePath