From d54a1cb41b815831e8b745cc0c03e590d08abc6a Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Wed, 28 Nov 2018 10:46:12 +0100 Subject: [PATCH] Handle null print job more elegantly Contributes to CL-1150 --- .../qml/MonitorPrintJobProgressBar.qml | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml index 6e16d026a1..f70e1175a1 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml @@ -97,16 +97,19 @@ Item id: progressItem; color: { - var state = printJob.state - var inactiveStates = [ - "pausing", - "paused", - "resuming", - "wait_cleanup" - ] - if (inactiveStates.indexOf(state) > -1 && remainingTime > 0) + if (printJob) { - return UM.Theme.getColor("monitor_progress_fill_inactive") + var state = printJob.state + var inactiveStates = [ + "pausing", + "paused", + "resuming", + "wait_cleanup" + ] + if (inactiveStates.indexOf(state) > -1 && remainingTime > 0) + { + return UM.Theme.getColor("monitor_progress_fill_inactive") + } } return "#0a0850" // TODO: Theme! }