From b1198ee1b8e8c24db4986599324c2acbbceb9850 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 27 Sep 2018 11:43:18 +0200 Subject: [PATCH] Remove an if-else block that assumes no ExtruderStack There is always an ExtruderStack, so the else-block will never be executed. --- cura/Settings/CustomSettingFunctions.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cura/Settings/CustomSettingFunctions.py b/cura/Settings/CustomSettingFunctions.py index fe3ea1a935..03cff6b069 100644 --- a/cura/Settings/CustomSettingFunctions.py +++ b/cura/Settings/CustomSettingFunctions.py @@ -40,13 +40,9 @@ class CustomSettingFunctions: global_stack = machine_manager.activeMachine extruder_stack = global_stack.extruders[str(extruder_position)] - if extruder_stack: - value = extruder_stack.getRawProperty(property_key, "value", context = context) - if isinstance(value, SettingFunction): - value = value(extruder_stack, context = context) - else: - # Just a value from global. - value = global_stack.getProperty(property_key, "value", context = context) + value = extruder_stack.getRawProperty(property_key, "value", context = context) + if isinstance(value, SettingFunction): + value = value(extruder_stack, context = context) return value