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 403ad26111
commit 2b865273f6

View File

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