mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-04 06:33:32 +07:00
Fixed relatively rare crash where the settings were being read but ended up null, not sure how that happened to start with...
This commit is contained in:
parent
31b4680b5f
commit
314b620405
@ -48,7 +48,10 @@ class GameSaver {
|
||||
fun getGeneralSettings(): GameSettings {
|
||||
val settingsFile = getGeneralSettingsFile()
|
||||
if(!settingsFile.exists()) return GameSettings()
|
||||
val settings = json().fromJson(GameSettings::class.java, settingsFile)
|
||||
var settings = json().fromJson(GameSettings::class.java, settingsFile)
|
||||
// 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()
|
||||
|
||||
val currentTileSets = ImageGetter.atlas.regions.asSequence()
|
||||
.filter { it.name.startsWith("TileSets") }
|
||||
|
Loading…
Reference in New Issue
Block a user