From 4bd5d29970f19aa2e038fb7f6e49860ce5a0d725 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 20 Sep 2018 18:41:30 +0200 Subject: [PATCH] Don't crash if the plugin is not found (maybe some error while loading). In that case it's better not to show the dialog than crashing. --- cura/CuraApplication.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index c7d7fff518..74c8e805af 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -13,6 +13,7 @@ from PyQt5.QtGui import QColor, QIcon from PyQt5.QtWidgets import QMessageBox from PyQt5.QtQml import qmlRegisterUncreatableType, qmlRegisterSingletonType, qmlRegisterType +from UM.PluginError import PluginNotFoundError from UM.Scene.SceneNode import SceneNode from UM.Scene.Camera import Camera from UM.Math.Vector import Vector @@ -1704,7 +1705,11 @@ class CuraApplication(QtApplication): @pyqtSlot() def showMoreInformationDialogForAnonymousDataCollection(self): - cast(SliceInfo, self._plugin_registry.getPluginObject("SliceInfoPlugin")).showMoreInfoDialog() + try: + slice_info = cast(SliceInfo, self._plugin_registry.getPluginObject("SliceInfoPlugin")) + slice_info.showMoreInfoDialog() + except PluginNotFoundError: + Logger.log("w", "Plugin SliceInfo was not found, so not able to show the info dialog.") def addSidebarCustomMenuItem(self, menu_item: dict) -> None: self._sidebar_custom_menu_items.append(menu_item)