From f5c8968aa68b4782e0ebb02b456742ca3e3eb4e8 Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Wed, 7 Mar 2012 12:28:56 +0100 Subject: [PATCH] A quick and ugly fix(try-except) for crashes involving multiselection --- deluge/ui/console/modes/alltorrents.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index 3dab24076..5ecc40679 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -614,7 +614,10 @@ class AllTorrents(BaseMode, component.Component): if lines: todraw = [] for l in lines: - todraw.append(self.formatted_rows[l]) + try: + todraw.append(self.formatted_rows[l]) + except: + pass #A quick and ugly fix for crash caused by doing shift-m on last torrent lines.reverse() else: todraw = self.formatted_rows[tidx-1:] @@ -656,7 +659,11 @@ class AllTorrents(BaseMode, component.Component): else: colorstr = "{!%s,%s!}"%(fg,bg) - self.add_string(currow,"%s%s"%(colorstr,row[0]),trim=False) + try: + self.add_string(currow,"%s%s"%(colorstr,row[0]),trim=False) + except: + #Yeah, this should be fixed in some better way + pass tidx += 1 currow += 1 if (currow > (self.rows - 2)):