Merge pull request #398 from u-alexandru/fix/history-file-not-found
Some checks failed
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled

fix: prevent stuck launch dialog when history file is missing
This commit is contained in:
aclist 2026-07-08 10:41:36 +09:00 committed by GitHub
commit e92df8c062
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)