From 494311e8df4acce43adc2de1a60b663f43f750e5 Mon Sep 17 00:00:00 2001 From: u-alexandru Date: Tue, 7 Jul 2026 12:08:40 +0300 Subject: [PATCH] fix: prevent stuck launch dialog when history file is missing update_history_file() opened dzg.history in read mode without handling a missing file. dzg.history is only created the first time it is written, so on a fresh install the very first server connection raised FileNotFoundError inside the post-launch cleanup callback: _destroy_on_idle -> _add_to_history_and_return -> update_history_file The exception propagated out of the GLib idle callback before destroy_dialog() ran, orphaning the "Waiting for DayZ to launch" modal so it could never be closed from the UI and its Cancel button was unresponsive. Treat a missing history file as an empty history so the first connection records history normally instead of crashing the cleanup callback. --- dzgui/managers/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dzgui/managers/config.py b/dzgui/managers/config.py index 7c87b3f..d2bdb87 100644 --- a/dzgui/managers/config.py +++ b/dzgui/managers/config.py @@ -55,8 +55,11 @@ class ConfigManager: self.update_config(Preferences.IP_LIST, ips) def update_history_file(self, fqip: str) -> None: - with open(self.prefs.paths.history, "r") as f: - ips = [line.rstrip() for line in f.readlines()] + try: + with open(self.prefs.paths.history, "r") as f: + ips = [line.rstrip() for line in f.readlines()] + except FileNotFoundError: + ips = [] seen = set() ips.append(fqip)