From b1bab817391308964bef544465fae5c496825902 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 29 Nov 2017 13:24:19 +0100 Subject: [PATCH] server: prevent crash when uploading to virustotal --- fdroidserver/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdroidserver/server.py b/fdroidserver/server.py index bd5a4426..004a6068 100644 --- a/fdroidserver/server.py +++ b/fdroidserver/server.py @@ -513,7 +513,7 @@ def upload_to_virustotal(repo_section, vt_apikey): with open(outputfilename, 'w') as fp: json.dump(response, fp, indent=2, sort_keys=True) - if response.get('positives') > 0: + if response.get('positives', 0) > 0: logging.warning(repofilename + ' has been flagged by virustotal ' + str(response['positives']) + ' times:' + '\n\t' + response['permalink'])