From 09244f235aae1a74dd0f14a0cbe230110e772ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Garapich?= Date: Thu, 26 Nov 2015 00:06:26 +0100 Subject: [PATCH] refs #511 Handle config plugin load failure If the config cannot be loaded properly, swift will not crash. The proper error will be shown instead. --- src/blackgui/components/settingssimulatorcomponent.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/blackgui/components/settingssimulatorcomponent.cpp b/src/blackgui/components/settingssimulatorcomponent.cpp index 9447c41f2..c53a2c18e 100644 --- a/src/blackgui/components/settingssimulatorcomponent.cpp +++ b/src/blackgui/components/settingssimulatorcomponent.cpp @@ -11,6 +11,7 @@ #include "blackmisc/logmessage.h" #include "blackmisc/variant.h" #include +#include using namespace BlackMisc; using namespace BlackMisc::PhysicalQuantities; @@ -276,6 +277,11 @@ namespace BlackGui QString configId = m_plugins->getPluginConfigId(selected->getIdentifier()); IPluginConfig *config = m_plugins->getPluginById(configId); + if (!config) + { + return; + } + CPluginConfigWindow *window = config->createConfigWindow(qApp->activeWindow()); CEnableForRuntime::setRuntimeForComponents(getRuntime(), window); window->setAttribute(Qt::WA_DeleteOnClose);