A quick and ugly fix(try-except) for crashes involving multiselection

This commit is contained in:
Asmageddon 2012-03-07 12:28:56 +01:00
parent 149cbae4dc
commit f5c8968aa6
1 changed files with 9 additions and 2 deletions

View File

@ -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)):