Fix potential keyerror for on_torrent_removed in sessionproxy

This commit is contained in:
Calum Lind 2012-02-24 00:34:53 +00:00
parent 31ff64b537
commit a494471ed4
1 changed files with 3 additions and 2 deletions

View File

@ -266,5 +266,6 @@ class SessionProxy(component.Component):
client.core.get_torrent_status(torrent_id, []).addCallback(on_status) client.core.get_torrent_status(torrent_id, []).addCallback(on_status)
def on_torrent_removed(self, torrent_id): def on_torrent_removed(self, torrent_id):
if torrent_id in self.torrents:
del self.torrents[torrent_id] del self.torrents[torrent_id]
del self.cache_times[torrent_id] del self.cache_times[torrent_id]