From 38dabfc1c0e9057c22827c09abc2e5659da567ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 7 Sep 2015 11:34:09 +0200 Subject: [PATCH] Only try to convert sorting_value to int if it's not None --- src/octoprint/plugin/core.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/octoprint/plugin/core.py b/src/octoprint/plugin/core.py index 028ba436..ce202600 100644 --- a/src/octoprint/plugin/core.py +++ b/src/octoprint/plugin/core.py @@ -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]