Fix the case that a quality_type is not available

CURA-5218
This commit is contained in:
Lipu Fei 2018-04-12 13:46:52 +02:00
parent e50be5cbe7
commit 8d3c3c0e80

View file

@ -1020,11 +1020,10 @@ class MachineManager(QObject):
quality_type = quality_changes_group.quality_type quality_type = quality_changes_group.quality_type
# A custom quality can be created based on "not supported". # A custom quality can be created based on "not supported".
# In that case, do not set quality containers to empty. # In that case, do not set quality containers to empty.
if quality_type == "not_supported": quality_group = None
quality_group = None if quality_type != "not_supported":
else:
quality_group_dict = self._quality_manager.getQualityGroups(self._global_container_stack) quality_group_dict = self._quality_manager.getQualityGroups(self._global_container_stack)
quality_group = quality_group_dict[quality_type] quality_group = quality_group_dict.get(quality_type)
quality_changes_container = self._empty_quality_changes_container quality_changes_container = self._empty_quality_changes_container
if quality_changes_group.node_for_global: if quality_changes_group.node_for_global: