Module: deluge
Branch: master
Commit: 78ea5c9bd39d9829cae0700b4feb876d633ea702

Author: Nick <[email protected]>
Date:   Wed Feb  2 18:32:03 2011 +0100

don't enter torrentdetails if nothing is selected

---

 deluge/ui/console/modes/alltorrents.py |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/deluge/ui/console/modes/alltorrents.py 
b/deluge/ui/console/modes/alltorrents.py
index 1991b04..5a201e8 100644
--- a/deluge/ui/console/modes/alltorrents.py
+++ b/deluge/ui/console/modes/alltorrents.py
@@ -606,11 +606,13 @@ class AllTorrents(BaseMode):
         elif c == curses.KEY_RIGHT:
             # We enter a new mode for the selected torrent here
             if not self.marked:
-                component.stop(["AllTorrentsStateUpdater"])
-                self.stdscr.clear()
-                td = 
TorrentDetail(self,self._current_torrent_id(),self.stdscr,self.encoding)
-                component.get("ConsoleUI").set_mode(td)
-                return
+                tid = self._current_torrent_id()
+                if tid:
+                    component.stop(["AllTorrentsStateUpdater"])
+                    self.stdscr.clear()
+                    td = 
TorrentDetail(self,self._current_torrent_id(),self.stdscr,self.encoding)
+                    component.get("ConsoleUI").set_mode(td)
+                    return
 
         # Enter Key
         elif c == curses.KEY_ENTER or c == 10:

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to