Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Prado Gesto <d.pradogesto@ultimaker.com>2017-11-02 11:51:57 +0300
committerDiego Prado Gesto <d.pradogesto@ultimaker.com>2017-11-02 11:51:57 +0300
commitd503283089d44e2a1c9a6798b8399e750f87edc5 (patch)
treeaa88182edb35dc93bef596b9e424aa555c8ecf86 /cura/PrintInformation.py
parent87a7bf72a8a7c4d9e3eaf5c93b91edb551cd8036 (diff)
CURA-4509 Minor fix that avoids crashes when there is no specified
material (such as in UM2)
Diffstat (limited to 'cura/PrintInformation.py')
-rw-r--r--cura/PrintInformation.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py
index c709bec20a..d3bcc10781 100644
--- a/cura/PrintInformation.py
+++ b/cura/PrintInformation.py
@@ -196,8 +196,10 @@ class PrintInformation(QObject):
weight = float(amount) * float(density) / 1000
cost = 0
+ material_name = catalog.i18nc("@label unknown material", "Unknown")
if material:
material_guid = material.getMetaDataEntry("GUID")
+ material_name = material.getName()
if material_guid in material_preference_values:
material_values = material_preference_values[material_guid]
@@ -216,7 +218,7 @@ class PrintInformation(QObject):
self._material_weights.append(weight)
self._material_lengths.append(length)
self._material_costs.append(cost)
- self._material_names.append(material.getName())
+ self._material_names.append(material_name)
self.materialLengthsChanged.emit()
self.materialWeightsChanged.emit()