Fix timestamp comparison failing when update API returns null

Addresses a rare instance of update checks failing when locally
installed packages point to a shared ID that has yet to be updated
to 2.1. In those instances Anki's update API returns null, which
causes a ValueError downstream when comparing the timestamps
against each other.
This commit is contained in:
Glutanimate 2019-04-08 17:51:15 +02:00
parent 1a5322a396
commit 4de09400c5

View File

@ -325,7 +325,7 @@ Are you sure you want to continue?"""
updated = []
for dir, ts in mods:
sid = str(dir)
if self.addonMeta(sid).get("mod",0) < ts:
if self.addonMeta(sid).get("mod", 0) < (ts or 0):
updated.append(sid)
return updated