Be a bit more gracefull when adding a machine failed

This seems to happen for people that manually add machines to cura
but mess something up when copying the files.

CURA-3X
This commit is contained in:
Jaime van Kessel 2020-02-28 17:03:38 +01:00
parent 27c6cb4c1e
commit 670a106957
No known key found for this signature in database
GPG key ID: 3710727397403C91
3 changed files with 13 additions and 7 deletions

View file

@ -58,7 +58,10 @@ class CuraStackBuilder:
# Create ExtruderStacks
extruder_dict = machine_definition.getMetaDataEntry("machine_extruder_trains")
for position in extruder_dict:
cls.createExtruderStackWithDefaultSetup(new_global_stack, position)
try:
cls.createExtruderStackWithDefaultSetup(new_global_stack, position)
except IndexError:
return None
for new_extruder in new_global_stack.extruders.values(): # Only register the extruders if we're sure that all of them are correct.
registry.addContainer(new_extruder)