Fix a couple of qml casting errors

This commit is contained in:
fieldOfView 2016-08-01 15:22:21 +02:00
parent a9ed562a58
commit 0c8d0a11a9
3 changed files with 6 additions and 4 deletions

View file

@ -83,7 +83,7 @@ UM.ManagementPage
Repeater
{
id: machineActionRepeater
model: Cura.MachineActionManager.getSupportedActions(Cura.MachineManager.getDefinitionByMachineId(base.currentItem.id))
model: base.currentItem ? Cura.MachineActionManager.getSupportedActions(Cura.MachineManager.getDefinitionByMachineId(base.currentItem.id)) : null
Button
{
@ -125,8 +125,8 @@ UM.ManagementPage
spacing: UM.Theme.getSize("default_margin").height
Label { text: catalog.i18nc("@label", "Type") }
Label { text: base.currentItem ? base.currentItem.metadata.definition_name : "" }
Label { text: catalog.i18nc("@label", "Type"); visible: base.currentItem }
Label { text: (base.currentItem && base.currentItem.metadata) ? base.currentItem.metadata.definition_name : "" }
}
UM.I18nCatalog { id: catalog; name: "uranium"; }