1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-05 17:00:10 +02:00

server: prevent crash when uploading to virustotal

This commit is contained in:
Hans-Christoph Steiner 2017-11-29 13:24:19 +01:00
parent 7389947cc3
commit b1bab81739

View File

@ -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'])