CURA-5334 Ensure the material manager is fetched before call

This commit is contained in:
Diego Prado Gesto 2018-06-14 13:24:07 +02:00
parent 95f7251486
commit 49abf38210

View file

@ -129,6 +129,7 @@ class MachineSettingsAction(MachineAction):
return
machine_manager = self._application.getMachineManager()
material_manager = self._application.getMaterialManager()
extruder_positions = list(self._global_container_stack.extruders.keys())
has_materials = self._global_container_stack.getProperty("machine_gcode_flavor", "value") != "UltiGCode"
@ -138,10 +139,6 @@ class MachineSettingsAction(MachineAction):
self._global_container_stack.setMetaDataEntry("has_materials", True)
else:
self._global_container_stack.addMetaDataEntry("has_materials", True)
# Set the material container for each extruder to a sane default
material_manager = self._application.getMaterialManager()
else:
# The metadata entry is stored in an ini, and ini files are parsed as strings only.
# Because any non-empty string evaluates to a boolean True, we have to remove the entry to make it False.