From b2ce1419cf8c8dddd9cbf954d91b7a5caf541d93 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 3 Jun 2020 17:48:28 +0200 Subject: [PATCH] Don't crash when syncing material that has no colour code Use the colour code for Generic PLA then. --- .../src/Models/Http/ClusterPrinterConfigurationMaterial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterConfigurationMaterial.py b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterConfigurationMaterial.py index 5d55f2f16b..6f2992a03b 100644 --- a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterConfigurationMaterial.py +++ b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterConfigurationMaterial.py @@ -54,4 +54,4 @@ class ClusterPrinterConfigurationMaterial(BaseModel): "name": "Empty" if self.material == "empty" else "Unknown" } - return MaterialOutputModel(guid = self.guid, type = material_metadata["material"], brand = material_metadata["brand"], color = material_metadata["color_code"], name = material_metadata["name"]) + return MaterialOutputModel(guid = self.guid, type = material_metadata["material"], brand = material_metadata["brand"], color = material_metadata.get("color_code", "#ffc924"), name = material_metadata["name"])