mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-21 20:19:32 +08:00
Prevent crash on setConnectionState when no global stack is set
This commit is contained in:
parent
994f110aed
commit
42b97d0d73
@ -137,7 +137,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||
"""
|
||||
if self.connectionState != connection_state:
|
||||
self._connection_state = connection_state
|
||||
cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack().setMetaDataEntry("is_online", self.isConnected())
|
||||
global_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()
|
||||
if global_stack:
|
||||
global_stack.setMetaDataEntry("is_online", self.isConnected())
|
||||
self.connectionStateChanged.emit(self._id)
|
||||
|
||||
@pyqtProperty(int, constant = True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user