Fix settings crash

This commit is contained in:
max-klaus 2020-09-07 12:06:17 +03:00
parent 48b0155892
commit d0374efb7b

View file

@ -996,7 +996,14 @@ public class OsmandSettings {
@Override
protected Boolean getValue(Object prefs, Boolean defaultValue) {
return parseString(settingsAPI.getString(prefs, getId(), defaultValue != null ? defaultValue.toString() : null));
Boolean value;
try {
value = parseString(settingsAPI.getString(prefs, getId(), defaultValue.toString()));
} catch (ClassCastException e) {
value = settingsAPI.getBoolean(prefs, getId(), defaultValue);
setValue(prefs, value);
}
return value;
}
@Override