Only try to convert sorting_value to int if it's not None

This commit is contained in:
Gina Häußge 2015-09-07 11:34:09 +02:00
parent b326b6bd33
commit 38dabfc1c0

View file

@ -1077,11 +1077,12 @@ class PluginManager(object):
except:
self.logger.exception("Error while trying to retrieve sorting order for plugin {}".format(impl[0]))
try:
int(sorting_value)
except ValueError:
self.logger.warn("The order value returned by {} for sorting context {} is not a valid integer, ignoring it".format(impl[0], sorting_context))
sorting_value = None
if sorting_value is not None:
try:
int(sorting_value)
except ValueError:
self.logger.warn("The order value returned by {} for sorting context {} is not a valid integer, ignoring it".format(impl[0], sorting_context))
sorting_value = None
return sorting_value is None, sorting_value, impl[0]