mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
On some "race" conditions, the torrent is removed before it's status could be retrieved. Return an empty status.
This commit is contained in:
parent
ffe0c168bb
commit
b5ea33e506
1 changed files with 5 additions and 1 deletions
|
@ -421,7 +421,11 @@ class Core(component.Component):
|
|||
@export
|
||||
def get_torrent_status(self, torrent_id, keys, diff=False):
|
||||
# Build the status dictionary
|
||||
status = self.torrentmanager[torrent_id].get_status(keys, diff)
|
||||
try:
|
||||
status = self.torrentmanager[torrent_id].get_status(keys, diff)
|
||||
except KeyError:
|
||||
# Torrent was probaly removed meanwhile
|
||||
return {}
|
||||
|
||||
# Get the leftover fields and ask the plugin manager to fill them
|
||||
leftover_fields = list(set(keys) - set(status.keys()))
|
||||
|
|
Loading…
Add table
Reference in a new issue