From 78ea5c9bd39d9829cae0700b4feb876d633ea702 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 2 Feb 2011 18:32:03 +0100 Subject: [PATCH] don't enter torrentdetails if nothing is selected --- deluge/ui/console/modes/alltorrents.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index 1991b0477..5a201e89c 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: