dont fail with old downloads

This commit is contained in:
j 2016-04-05 01:21:43 +02:00
parent f16ac0e3c1
commit c7ce20a3b9
1 changed files with 4 additions and 1 deletions

View File

@ -41,7 +41,10 @@ class Downloads(Thread):
import item.models
self.download_updates()
downloads = list(self.transfers.items())
downloads.sort(key=lambda t: t[1].get('added'))
try:
downloads.sort(key=lambda t: t[1].get('added'))
except:
pass
for itemid, t in downloads:
if state.shutdown:
return False