Fix settings crash
This commit is contained in:
parent
48b0155892
commit
d0374efb7b
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue