From 1a8c3d21be70372d18ddae7cd77b998b6e5baac1 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Thu, 24 Apr 2008 07:58:52 +0000 Subject: [PATCH] Fix issue where trying to handle an announce alert after the torrent has been removed from session. --- deluge/core/torrentmanager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index aa3880881..1f6170f4a 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -662,7 +662,12 @@ class TorrentManager(component.Component): def on_alert_tracker_announce(self, alert): log.debug("on_alert_tracker_announce") # Get the torrent_id - torrent_id = str(alert.handle.info_hash()) + try: + torrent_id = str(alert.handle.info_hash()) + except RuntimeError: + log.debug("Invalid torrent handle.") + return + # Set the tracker status for the torrent try: self.torrents[torrent_id].set_tracker_status(_("Announce Sent"))