From: Daniel Martí Date: Mon, 26 Sep 2016 20:07:55 +0000 (+0100) Subject: checkupdates: avoid crash with --auto and None CVC X-Git-Tag: 0.8~157^2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=bcd31401ac03a79abc1c6f2561afd08b77ac1bb0;p=fdroidserver.git checkupdates: avoid crash with --auto and None CVC Reproducible via `fdroid checkupdates --auto subreddit.android.appstore` at fdroiddata HEAD (e76449ab). WARNING: ...subreddit.android.appstore : Couldn't find package ID CRITICAL: Unknown exception found! Traceback (most recent call last): File "/home/mvdan/.bin/fdroid", line 147, in main() File "/home/mvdan/.bin/fdroid", line 124, in main mod.main() File "/home/mvdan/git/fsr/fdroidserver/checkupdates.py", line 571, in main checkupdates_app(app) File "/home/mvdan/git/fsr/fdroidserver/checkupdates.py", line 469, in checkupdates_app if int(build.vercode) >= int(app.CurrentVersionCode): TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' --- diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index b754bf10..2cc21e56 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -452,7 +452,9 @@ def checkupdates_app(app, first=True): if options.auto: mode = app.AutoUpdateMode - if mode in ('None', 'Static'): + if not app.CurrentVersionCode: + logging.warn("Can't auto-update app with no current version code: " + app.id) + elif mode in ('None', 'Static'): pass elif mode.startswith('Version '): pattern = mode[8:]