From 65e1314538d87fd54dad9acc10794ba1d071aec1 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 13 Feb 2020 12:26:49 +0100 Subject: [PATCH] Fix QML null warnings --- resources/qml/Cura.qml | 2 +- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 2 +- resources/qml/PrintSetupSelector/PrintSetupSelector.qml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index ba305a1104..48be891a71 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -24,7 +24,7 @@ UM.MainWindow title: { let result = ""; - if(PrintInformation.jobName != "") + if(PrintInformation !== null && PrintInformation.jobName != "") { result += PrintInformation.jobName + " - "; } diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 22f10188e1..372c3897e3 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -196,7 +196,7 @@ Button rightMargin: UM.Theme.getSize("wide_margin").width } height: childrenRect.height - visible: configuration.buildplateConfiguration != "" && false //Buildplate is disabled as long as we have no printers that properly support buildplate swapping (so we can't test). + visible: configuration !== null && configuration.buildplateConfiguration != "" && false //Buildplate is disabled as long as we have no printers that properly support buildplate swapping (so we can't test). // Show the type of buildplate. The first letter is capitalized Cura.IconWithText diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml index 1a9bd9f109..414c349bb6 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml @@ -13,7 +13,7 @@ Cura.ExpandableComponent dragPreferencesNamePrefix: "view/settings" - property bool preSlicedData: PrintInformation.preSliced + property bool preSlicedData: PrintInformation !== null && PrintInformation.preSliced contentPadding: UM.Theme.getSize("default_lining").width contentHeaderTitle: catalog.i18nc("@label", "Print settings")