Fix typing

This commit is contained in:
Lipu Fei 2019-09-19 14:34:52 +02:00
parent d8b59c4471
commit 6e625b2cf8

View file

@ -1305,9 +1305,10 @@ class MachineManager(QObject):
self._setMaterial(position_item, new_material)
else:
# The current material is not available, find the preferred one.
approximate_material_diameter = int(self._global_container_stack.extruderList[int(position)].getApproximateMaterialDiameter())
material_node = nozzle_node.preferredMaterial(approximate_material_diameter)
self._setMaterial(position_item, material_node)
if position is not None:
approximate_material_diameter = int(self._global_container_stack.extruderList[int(position)].getApproximateMaterialDiameter())
material_node = nozzle_node.preferredMaterial(approximate_material_diameter)
self._setMaterial(position_item, material_node)
## Given a printer definition name, select the right machine instance. In case it doesn't exist, create a new
# instance with the same network key.