Don't crash if CuraStackBuilder failed to create a stack

If it failed to create a global stack, the extruder_stack_dict variable would not be defined, and Cura crashes. It may fail to create a stack because of an indexerror in a malformed project file.

Fixes Sentry issue CURA-137.
This commit is contained in:
Ghostkeeper 2020-08-10 11:16:07 +02:00
parent ba0efb82bc
commit fc6ea28352
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -758,6 +758,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
Job.yieldThread() Job.yieldThread()
QCoreApplication.processEvents() # Ensure that the GUI does not freeze. QCoreApplication.processEvents() # Ensure that the GUI does not freeze.
if global_stack:
# Handle quality changes if any # Handle quality changes if any
self._processQualityChanges(global_stack) self._processQualityChanges(global_stack)