From 9ed37e070c8e9371ba1e8752ebac74cad21759cc Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Mon, 27 Apr 2009 22:14:49 +0000 Subject: [PATCH] Return if bad torrent_info --- deluge/core/torrentmanager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 7c8cd0a53..1eed23ea7 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -278,6 +278,8 @@ class TorrentManager(component.Component): torrent_info = lt.torrent_info(lt.bdecode(filedump)) except Exception, e: log.error("Unable to decode torrent file!: %s", e) + # XXX: Probably should raise an exception here.. + return if torrent_info is None and state: # We have no torrent_info so we need to add the torrent with information @@ -751,7 +753,7 @@ class TorrentManager(component.Component): torrent = self.torrents[torrent_id] except: return - + old_state = torrent.state torrent.update_state() # Only emit a state changed event if the state has actually changed