Not being able to read the settings file shouldn't make you crash
Happened to 2 users out of almost 400K, but it's an easy fix so why not help the 0.005%
This commit is contained in:
parent
0289af28ce
commit
8f583732aa
1 changed files with 5 additions and 1 deletions
|
@ -55,7 +55,11 @@ class GameSaver {
|
|||
fun getGeneralSettings(): GameSettings {
|
||||
val settingsFile = getGeneralSettingsFile()
|
||||
if(!settingsFile.exists()) return GameSettings()
|
||||
var settings = json().fromJson(GameSettings::class.java, settingsFile)
|
||||
var settings: GameSettings?=null
|
||||
try {
|
||||
settings = json().fromJson(GameSettings::class.java, settingsFile)
|
||||
}
|
||||
catch (ex:Exception){}
|
||||
// I'm not sure of the circumstances,
|
||||
// but some people were getting null settings, even though the file existed??? Very odd.
|
||||
if(settings==null) settings = GameSettings()
|
||||
|
|
Loading…
Reference in a new issue