From 41684befac94e3932cebb7a690cadb6a9376d46a Mon Sep 17 00:00:00 2001 From: Hoang Hong Quan Date: Sat, 27 Jul 2024 19:01:08 +0700 Subject: [PATCH] Ensure the value is always valid --- Scripts/gathering_files.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Scripts/gathering_files.py b/Scripts/gathering_files.py index 7b6008c..31e99e7 100755 --- a/Scripts/gathering_files.py +++ b/Scripts/gathering_files.py @@ -262,7 +262,9 @@ class gatheringFiles: "last_updated": "2024-07-25T12:00:00" } - last_updated = datetime.fromisoformat(download_history["last_updated"] or "2024-07-25T12:00:00") + if not download_history.get("versions"): + download_history["versions"] = [] + last_updated = datetime.fromisoformat(download_history.get("last_updated", "2024-07-25T12:00:00")) current_time = datetime.now() if current_time - last_updated < timedelta(minutes=10):