From e575399baa35b05716448b367d5e3cd6c2354b3b Mon Sep 17 00:00:00 2001 From: SomeTroglodyte <63000004+SomeTroglodyte@users.noreply.github.com> Date: Fri, 10 Sep 2021 12:02:25 +0200 Subject: [PATCH] Prevent packaged exe being shot down by mod atlas packing failures (#5169) --- desktop/src/com/unciv/app/desktop/ImagePacker.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/desktop/src/com/unciv/app/desktop/ImagePacker.kt b/desktop/src/com/unciv/app/desktop/ImagePacker.kt index aa20ff7019..fd38dd1f69 100644 --- a/desktop/src/com/unciv/app/desktop/ImagePacker.kt +++ b/desktop/src/com/unciv/app/desktop/ImagePacker.kt @@ -72,8 +72,13 @@ internal object ImagePacker { val modDirectory = File("mods") if (modDirectory.exists()) { for (mod in modDirectory.listFiles()!!) { - if (!mod.isHidden && File(mod.path + "/Images").exists()) - packImagesIfOutdated(defaultSettings, mod.path + "/Images", mod.path, "game") + if (!mod.isHidden && File(mod.path + "/Images").exists()) { + try { + packImagesIfOutdated(defaultSettings, mod.path + "/Images", mod.path, "game") + } catch (ex: Throwable) { + println("Exception in ImagePacker: ${ex.message}") + } + } } }