downloads might be gone in shutdown

This commit is contained in:
j 2016-02-14 13:07:27 +05:30
parent f7d96747c0
commit 0689563c4d
1 changed files with 1 additions and 1 deletions

View File

@ -130,7 +130,7 @@ class Item(db.Model):
j['timesaccessed'] = self.timesaccessed
j['accessed'] = self.accessed
j['added'] = self.added
if state.downloads:
if state.downloads and not state.shutdown:
t = state.downloads.transfers.get(self.id)
if t:
j['transferadded'] = t['added']