no exception on invalid sort

This commit is contained in:
Martijn Voncken 2008-02-26 00:33:27 +00:00
parent 79b9eda351
commit a7b12cc159
1 changed files with 5 additions and 1 deletions

View File

@ -144,7 +144,11 @@ class index:
#sorting:
if vars.sort:
torrent_list.sort(key=attrgetter(vars.sort))
try:
torrent_list.sort(key=attrgetter(vars.sort))
except:
log.debug('Sorting Failed')
if vars.order == 'up':
torrent_list = reversed(torrent_list)