From ac560229a1190b8b9e51a8be50c2b4e42e6f1bb9 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 3 May 2017 10:45:39 +0200 Subject: [PATCH] Fix TypeError in JobSpec.qml due to material cost being undefined --- resources/qml/JobSpecs.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index 54b559f794..6013117728 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -212,8 +212,9 @@ Item { { lengths.push(base.printMaterialLengths[index].toFixed(2)); weights.push(String(Math.floor(base.printMaterialWeights[index]))); - costs.push(base.printMaterialCosts[index].toFixed(2)); - if(base.printMaterialCosts[index] > 0) + var cost = base.printMaterialCosts[index] == undefined ? 0 : base.printMaterialCosts[index].toFixed(2); + costs.push(cost); + if(cost > 0) { someCostsKnown = true; }