"Save game" errors are now correctly caught and displayed to the user

This commit is contained in:
Yair Morgenstern
2021-01-28 14:59:16 +02:00
parent 852c06ae07
commit 68498ec7ba

View File

@ -45,8 +45,12 @@ object GameSaver {
if (customSaveLocation != null && customSaveLocationHelper != null) {
customSaveLocationHelper.saveGame(game, GameName, forcePrompt, saveCompletionCallback)
} else {
json().toJson(game, getSave(GameName, multiplayer))
saveCompletionCallback?.invoke(null)
try {
json().toJson(game, getSave(GameName, multiplayer))
saveCompletionCallback?.invoke(null)
} catch (ex: Exception) {
saveCompletionCallback?.invoke(ex)
}
}
}