Gracefully handle the case where machine definition is no in the map

This commit is contained in:
Jaime van Kessel 2018-11-28 11:42:54 +01:00
parent c0d1c35a2b
commit 0baa4d20b3

View File

@ -107,7 +107,7 @@ class VariantManager:
break
return variant_node
return self._machine_to_variant_dict_map[machine_definition_id].get(variant_type, {}).get(variant_name)
return self._machine_to_variant_dict_map.get(machine_definition_id, {}).get(variant_type, {}).get(variant_name)
def getVariantNodes(self, machine: "GlobalStack", variant_type: "VariantType") -> Dict[str, ContainerNode]:
machine_definition_id = machine.definition.getId()