mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Prevent crash in model if no extruder is set
CURA-6598
This commit is contained in:
parent
b56c09bcf4
commit
f4dc93fc39
2 changed files with 3 additions and 2 deletions
|
@ -103,6 +103,8 @@ class BaseMaterialsModel(ListModel):
|
||||||
# tree. This change may trigger an _update() call when the materials
|
# tree. This change may trigger an _update() call when the materials
|
||||||
# changed for the configuration that this model is looking for.
|
# changed for the configuration that this model is looking for.
|
||||||
def _materialsListChanged(self, material: MaterialNode) -> None:
|
def _materialsListChanged(self, material: MaterialNode) -> None:
|
||||||
|
if self._extruder_stack is None:
|
||||||
|
return
|
||||||
if material.variant.container_id != self._extruder_stack.variant.getId():
|
if material.variant.container_id != self._extruder_stack.variant.getId():
|
||||||
return
|
return
|
||||||
if material.variant.machine.container_id != cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack().definition.getId():
|
if material.variant.machine.container_id != cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack().definition.getId():
|
||||||
|
|
|
@ -20,8 +20,7 @@ SettingItem
|
||||||
textRole: "value"
|
textRole: "value"
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
highlighted: base.hovered
|
|
||||||
|
|
||||||
onActivated:
|
onActivated:
|
||||||
{
|
{
|
||||||
forceActiveFocus()
|
forceActiveFocus()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue