From e79461c7d2037820e4f51c00b21647d16dc87bd6 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 30 Jun 2010 16:21:34 -0700 Subject: [PATCH] Fix issue where a new lt state will cause an uncaught exception --- deluge/core/torrent.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index b01a97105..27989b8a6 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -331,6 +331,10 @@ class Torrent: LTSTATE = deluge.common.LT_TORRENT_STATE ltstate = int(self.handle.status().state) + # Set self.state to the ltstate right away just incase we don't hit some + # of the logic below + self.state = str(ltstate) + log.debug("set_state_based_on_ltstate: %s", deluge.common.LT_TORRENT_STATE[ltstate]) log.debug("session.is_paused: %s", component.get("Core").session.is_paused())