From f8a88642c2258fefd9d5c4be717d64a3b4adbd68 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 18 Jun 2020 14:53:18 +0200 Subject: [PATCH] Don't crash when failing to create Toolbox.qml dialogue Basically we should never be raising the master Exception class, really. The enclosing class has error handling in case this returns None already, so this fix is easy. Contributes to Sentry issue CURA-Y5. --- cura/Scene/CuraSceneNode.py | 6 +++--- plugins/Toolbox/src/Toolbox.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cura/Scene/CuraSceneNode.py b/cura/Scene/CuraSceneNode.py index 7337a3a32f..c22277a4b0 100644 --- a/cura/Scene/CuraSceneNode.py +++ b/cura/Scene/CuraSceneNode.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Ultimaker B.V. +# Copyright (c) 2020 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from copy import deepcopy @@ -119,9 +119,9 @@ class CuraSceneNode(SceneNode): self._aabb = None if self._mesh_data: self._aabb = self._mesh_data.getExtents(self.getWorldTransformation()) - else: # If there is no mesh_data, use a boundingbox that encompasses the local (0,0,0) + else: # If there is no mesh_data, use a bounding box that encompasses the local (0,0,0) position = self.getWorldPosition() - self._aabb = AxisAlignedBox(minimum=position, maximum=position) + self._aabb = AxisAlignedBox(minimum = position, maximum = position) for child in self.getAllChildren(): if child.callDecoration("isNonPrintingMesh"): diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 0ad9f7c89c..876ca586a7 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Ultimaker B.V. +# Copyright (c) 2020 Ultimaker B.V. # Toolbox is released under the terms of the LGPLv3 or higher. import json @@ -232,7 +232,7 @@ class Toolbox(QObject, Extension): "licenseModel": self._license_model }) if not dialog: - raise Exception("Failed to create Marketplace dialog") + return None return dialog def _convertPluginMetadata(self, plugin_data: Dict[str, Any]) -> Optional[Dict[str, Any]]: