[#2957] [GTKUI] Fix AttributeError in torrentview column sort

This commit is contained in:
Calum Lind 2017-02-20 10:02:54 +00:00
parent 14d9b6cfcb
commit c2c0fe86f9
1 changed files with 7 additions and 2 deletions

View File

@ -31,8 +31,13 @@ def str_nocase_sort(model, iter1, iter2, data):
Sort string column data with locale.strcoll which (allegedly) uses ISO 14651.
"""
try:
v1 = model[iter1][data].lower()
v2 = model[iter2][data].lower()
except AttributeError:
# Catch None type for value.
v1 = model[iter1][data]
v2 = model[iter2][data]
return strcoll(v1, v2)