mirror of
https://github.com/aclist/dztui.git
synced 2026-08-27 02:07:18 +02:00
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
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:
commit
e92df8c062
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user