From 8c46a3f6d4f401da11ff616b1340bb426d405eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Garapich?= Date: Tue, 12 May 2015 23:01:57 +0100 Subject: [PATCH] refs #422 Take care of failed ISimulator::connectTo() --- src/blackcore/context_simulator_impl.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/blackcore/context_simulator_impl.cpp b/src/blackcore/context_simulator_impl.cpp index efa25d5d1..ef2377e9f 100644 --- a/src/blackcore/context_simulator_impl.cpp +++ b/src/blackcore/context_simulator_impl.cpp @@ -410,10 +410,16 @@ namespace BlackCore // try to connect m_simulatorPlugin->simulator->asyncConnectTo(); - // info about what is going on - emit simulatorPluginChanged(this->m_simulatorPlugin->info); - CLogMessage(this).info("Simulator plugin loaded: %1") << this->m_simulatorPlugin->info.toQString(true); - return true; + if (m_simulatorPlugin) // can be already nullptr if connectTo() is synchronous and fails + { + emit simulatorPluginChanged(this->m_simulatorPlugin->info); + CLogMessage(this).info("Simulator plugin loaded: %1") << this->m_simulatorPlugin->info.toQString(true); + return true; + } + else + { + return false; + } } bool CContextSimulator::loadSimulatorPluginFromSettings()