Handle invalid install timestamps in add-ons

https://forums.ankiweb.net/t/anki-23-12-beta/37771/57
This commit is contained in:
Damien Elmes 2023-12-05 12:07:11 +10:00
parent 80c5f2d491
commit 25bc32b1e2
1 changed files with 7 additions and 3 deletions

View File

@ -292,10 +292,14 @@ class ErrorHandler(QObject):
def addon_fmt(addmgr: AddonManager, addon: AddonMeta) -> str:
installed = "0"
if addon.installed_at:
installed = time.strftime("%Y-%m-%dT%H:%M", time.localtime(addon.installed_at))
else:
installed = "0"
try:
installed = time.strftime(
"%Y-%m-%dT%H:%M", time.localtime(addon.installed_at)
)
except OverflowError:
print("invalid timestamp for", addon.provided_name)
if addon.provided_name:
name = addon.provided_name
else: