Fixed a crash when trying to change sort order from an invisible column

This commit is contained in:
Asmageddon 2012-07-14 11:50:34 +02:00
parent c554bf9edd
commit 246a8409bf
1 changed files with 2 additions and 0 deletions

View File

@ -1239,6 +1239,7 @@ class AllTorrents(BaseMode, component.Component):
pass pass
i = max(0, i) i = max(0, i)
i = min(len(self.__cols_to_show) - 1, i)
self.config["sort_primary"] = self.__cols_to_show[i] self.config["sort_primary"] = self.__cols_to_show[i]
self.config.save() self.config.save()
@ -1254,6 +1255,7 @@ class AllTorrents(BaseMode, component.Component):
pass pass
i = min(len(self.__cols_to_show) - 1, i) i = min(len(self.__cols_to_show) - 1, i)
i = max(0, i)
self.config["sort_primary"] = self.__cols_to_show[i] self.config["sort_primary"] = self.__cols_to_show[i]
self.config.save() self.config.save()