Don't crash when materials are not registered

It can't update the nodes structure with the links between materials then.

Contributes to issue CURA-6444.
This commit is contained in:
Ghostkeeper 2019-05-01 13:14:40 +02:00
parent d1a29ca87d
commit 8d6136bcf3
No known key found for this signature in database
GPG Key ID: 86BEF881AE2CF276

View File

@ -103,6 +103,8 @@ class MaterialManager(QObject):
continue
root_material_id = material_metadata.get("base_file", "")
if root_material_id not in material_metadatas: #Not a registered material profile. Don't store this in the look-up tables.
continue
if root_material_id not in self._material_group_map:
self._material_group_map[root_material_id] = MaterialGroup(root_material_id, MaterialNode(material_metadatas[root_material_id]))
self._material_group_map[root_material_id].is_read_only = self._container_registry.isReadOnly(root_material_id)