mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-19 16:39:10 +08:00
Fix crash when adding USB device before global stack is created
Like when you plug in a 3D printer via USB while still in the welcome screen. Fixes Sentry issue CURA-1ZR.
This commit is contained in:
parent
1f9b4c3964
commit
bcf180985d
@ -211,6 +211,8 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||||||
|
|
||||||
def _onGlobalContainerStackChanged(self):
|
def _onGlobalContainerStackChanged(self):
|
||||||
container_stack = CuraApplication.getInstance().getGlobalContainerStack()
|
container_stack = CuraApplication.getInstance().getGlobalContainerStack()
|
||||||
|
if container_stack is None:
|
||||||
|
return
|
||||||
num_extruders = container_stack.getProperty("machine_extruder_count", "value")
|
num_extruders = container_stack.getProperty("machine_extruder_count", "value")
|
||||||
# Ensure that a printer is created.
|
# Ensure that a printer is created.
|
||||||
controller = GenericOutputController(self)
|
controller = GenericOutputController(self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user