diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 2c99ce2dd3..b78cade1de 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -252,8 +252,18 @@ Column { id: materialSelection - text: Cura.MachineManager.currentRootMaterialName[base.currentExtruderIndex] - tooltip: Cura.MachineManager.currentRootMaterialName[base.currentExtruderIndex] + property var currentRootMaterialName: + { + var materials = Cura.MachineManager.currentRootMaterialName; + var materialName = ""; + if (base.currentExtruderIndex in materials) { + materialName = materials[base.currentExtruderIndex]; + } + return materialName; + } + + text: currentRootMaterialName + tooltip: currentRootMaterialName visible: Cura.MachineManager.hasMaterials enabled: !extrudersList.visible || base.currentExtruderIndex > -1 height: UM.Theme.getSize("setting_control").height