Index: binaries/data/mods/public/gui/gamesetup/Controllers/GameSettingsController.js =================================================================== --- binaries/data/mods/public/gui/gamesetup/Controllers/GameSettingsController.js +++ binaries/data/mods/public/gui/gamesetup/Controllers/GameSettingsController.js @@ -85,8 +85,18 @@ if (initData?.gameSettings) this.persistentMatchSettings.enabled = !!initData.gameSettings?.usePersistence; const settings = initData?.gameSettings || this.persistentMatchSettings.loadFile(); - if (settings) - this.parseSettings(settings); + // This initial settings parsing in wrapped in a try-catch because it can fail unexpectedly, + // and particularly could fail with mods that change persistent settings, so this is + // difficult to fully fix from the gameSettings code. + try { + if (settings) + this.parseSettings(settings); + } catch(err) { + error("There was an error loading game settings. You may need to disable persistent match settings."); + warn(err?.toString() ?? uneval(err)); + if (err.stack) + warn(err.stack) + } } // If the new settings led to AI & players conflict, remove the AI. for (const guid in g_PlayerAssignments)