CURA-4870 Don't crash when there is not buildplate variant for the

current machine
This commit is contained in:
Diego Prado Gesto 2018-03-08 15:36:12 +01:00
parent ae094c8201
commit 591d3f29ec
2 changed files with 7 additions and 2 deletions

View file

@ -132,4 +132,6 @@ class VariantManager:
return node
def getBuildplateVariantNode(self, machine_definition_id: str, buildplate_type: str) -> Optional["ContainerNode"]:
return self._machine_to_buildplate_dict_map[machine_definition_id].get(buildplate_type)
if machine_definition_id in self._machine_to_buildplate_dict_map:
return self._machine_to_buildplate_dict_map[machine_definition_id].get(buildplate_type)
return None