Set default value for digits per group if loaded invalid value
This commit is contained in:
parent
807e13d239
commit
b32807de9e
@ -134,6 +134,11 @@ public class MainController implements Initializable {
|
|||||||
xmlMapper.writeValue(new File(filePath.toString()), settings);
|
xmlMapper.writeValue(new File(filePath.toString()), settings);
|
||||||
} else {
|
} else {
|
||||||
settings = xmlMapper.readValue(new File(filePath.toString()), MainSettings.class);
|
settings = xmlMapper.readValue(new File(filePath.toString()), MainSettings.class);
|
||||||
|
for (StationSettings station : settings.getStations()) {
|
||||||
|
if (station.getDigitsPerGroup() == 0) {
|
||||||
|
station.setDigitsPerGroup(4);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// Print the contents of filePath
|
// Print the contents of filePath
|
||||||
|
Loading…
x
Reference in New Issue
Block a user