mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Prevent crash on setConnectionState when no global stack is set
This commit is contained in:
parent
994f110aed
commit
42b97d0d73
1 changed files with 3 additions and 1 deletions
|
|
@ -137,7 +137,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
"""
|
"""
|
||||||
if self.connectionState != connection_state:
|
if self.connectionState != connection_state:
|
||||||
self._connection_state = 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)
|
self.connectionStateChanged.emit(self._id)
|
||||||
|
|
||||||
@pyqtProperty(int, constant = True)
|
@pyqtProperty(int, constant = True)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue