From 246a8409bf18325e14ba8d22a9471b7ae7a055da Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Sat, 14 Jul 2012 11:50:34 +0200 Subject: [PATCH] Fixed a crash when trying to change sort order from an invisible column --- deluge/ui/console/modes/alltorrents.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index 59b2e9056..c49678efb 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -1239,6 +1239,7 @@ class AllTorrents(BaseMode, component.Component): pass i = max(0, i) + i = min(len(self.__cols_to_show) - 1, i) self.config["sort_primary"] = self.__cols_to_show[i] self.config.save() @@ -1254,6 +1255,7 @@ class AllTorrents(BaseMode, component.Component): pass i = min(len(self.__cols_to_show) - 1, i) + i = max(0, i) self.config["sort_primary"] = self.__cols_to_show[i] self.config.save()