From 600f262ccab6dff7384df93bfdddbc558ee3c4a7 Mon Sep 17 00:00:00 2001 From: SomeTroglodyte <63000004+SomeTroglodyte@users.noreply.github.com> Date: Wed, 21 Apr 2021 22:42:45 +0200 Subject: [PATCH] Fixes #3729 "Android crash on loading from custom location" (#3828) --- core/src/com/unciv/ui/saves/LoadGameScreen.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/ui/saves/LoadGameScreen.kt b/core/src/com/unciv/ui/saves/LoadGameScreen.kt index 7ca6e0f61f..774f6a973b 100644 --- a/core/src/com/unciv/ui/saves/LoadGameScreen.kt +++ b/core/src/com/unciv/ui/saves/LoadGameScreen.kt @@ -96,7 +96,9 @@ class LoadGameScreen(previousScreen:CameraStageBaseScreen) : PickerScreen() { loadFromCustomLocation.onClick { GameSaver.loadGameFromCustomLocation { gameInfo, exception -> if (gameInfo != null) { - game.loadGame(gameInfo) + Gdx.app.postRunnable { + game.loadGame(gameInfo) + } } else if (exception !is CancellationException) { errorLabel.setText("Could not load game from custom location!".tr()) exception?.printStackTrace() @@ -195,4 +197,4 @@ class LoadGameScreen(previousScreen:CameraStageBaseScreen) : PickerScreen() { } } -} \ No newline at end of file +}