From 2333cb09e79dbe95df7eb41d14656d4d778aa2e1 Mon Sep 17 00:00:00 2001 From: Lucas Walter Date: Tue, 6 Mar 2018 11:32:59 -0800 Subject: [PATCH] Avoid crash when a plugin in .perspective is not available (#110) * Avoid crash when plugin in .perspective is not available and just print a warning #109 * More context in warning --- qt_gui/src/qt_gui/plugin_manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qt_gui/src/qt_gui/plugin_manager.py b/qt_gui/src/qt_gui/plugin_manager.py index b84057f0..39df6bc5 100644 --- a/qt_gui/src/qt_gui/plugin_manager.py +++ b/qt_gui/src/qt_gui/plugin_manager.py @@ -222,6 +222,11 @@ def _load_plugin_load(self, instance_id, callback, argv=None): handler.set_minimized_dock_widgets_toolbar(self._minimized_dock_widgets_toolbar) + if instance_id.plugin_id not in self._plugin_descriptors.keys(): + qWarning( + 'PluginManager._load_plugin() could not load plugin "%s": plugin not available' % + (instance_id.plugin_id)) + return plugin_descriptor = self._plugin_descriptors[instance_id.plugin_id] handler.set_plugin_descriptor(plugin_descriptor)