From b6b7ec8de8a2c576eef50963dfce4aed409b38dd Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 15 Nov 2018 23:08:46 +0100 Subject: [PATCH] Fix typing issues --- plugins/BlackBeltPlugin/FlavorParserPatches.py | 2 +- plugins/BlackBeltPlugin/PatchedMaterialManager.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/BlackBeltPlugin/FlavorParserPatches.py b/plugins/BlackBeltPlugin/FlavorParserPatches.py index fc54df7f83..58bb16f36d 100644 --- a/plugins/BlackBeltPlugin/FlavorParserPatches.py +++ b/plugins/BlackBeltPlugin/FlavorParserPatches.py @@ -17,7 +17,7 @@ class FlavorParserPatches(): def processGCodeStream(self, stream: str) -> Optional[CuraSceneNode]: scene_node = self.__processGCodeStream(stream) if not scene_node: - return + return None root = CuraApplication.getInstance().getController().getScene().getRoot() root.callDecoration("calculateTransformData") diff --git a/plugins/BlackBeltPlugin/PatchedMaterialManager.py b/plugins/BlackBeltPlugin/PatchedMaterialManager.py index 6aee5d7db5..9d6c01745f 100644 --- a/plugins/BlackBeltPlugin/PatchedMaterialManager.py +++ b/plugins/BlackBeltPlugin/PatchedMaterialManager.py @@ -63,7 +63,8 @@ class PatchedMaterialManager(MaterialManager): # Do not exclude other materials that are of the same type. for material_id, node in current_node.material_map.items(): ### START PATCH - if machine_limit_materials and node.getContainer().getId() == material_id: + node_container = node.getContainer() + if machine_limit_materials and node_container and node_container.getId() == material_id: # For the materials we want Cura creates a variant-specific InstanceContainer # If the InstanceContainer is not variant-specific then we are not interested continue