Catch case where there is no global stack

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-08-27 11:14:07 +02:00
parent 78db68369e
commit 84c6ec36dc
No known key found for this signature in database
GPG Key ID: 86BEF881AE2CF276

View File

@ -1548,6 +1548,8 @@ class MachineManager(QObject):
@pyqtProperty(str, notify = activeQualityGroupChanged)
def activeQualityOrQualityChangesName(self) -> str:
global_container_stack = CuraApplication.getInstance().getGlobalContainerStack()
if not global_container_stack:
return CuraApplication.getInstance().empty_quality_container.getName()
if global_container_stack.qualityChanges != CuraApplication.getInstance().empty_quality_changes_container:
return global_container_stack.qualityChanges.getName()
return global_container_stack.quality.getName()