diff --git a/src/blackcore/context/contextsimulatorimpl.cpp b/src/blackcore/context/contextsimulatorimpl.cpp index 3211cd723..c5d79f968 100644 --- a/src/blackcore/context/contextsimulatorimpl.cpp +++ b/src/blackcore/context/contextsimulatorimpl.cpp @@ -419,7 +419,7 @@ namespace BlackCore } ISimulatorListener *listener = m_plugins->createListener(simulatorInfo.getIdentifier()); - Q_ASSERT_X(listener, Q_FUNC_INFO, "No listener"); + if (!listener) { return; } if (listener->thread() != &m_listenersThread) { diff --git a/src/blackcore/pluginmanagersimulator.cpp b/src/blackcore/pluginmanagersimulator.cpp index 126025604..88ea693f5 100644 --- a/src/blackcore/pluginmanagersimulator.cpp +++ b/src/blackcore/pluginmanagersimulator.cpp @@ -11,6 +11,7 @@ #include "blackcore/pluginmanagersimulator.h" #include "blackcore/simulator.h" #include "blackmisc/directoryutils.h" +#include "blackmisc/logmessage.h" #include #include @@ -42,9 +43,10 @@ namespace BlackCore PluginExtended &plugin = m_plugins[pluginId]; if (!plugin.listener) { - ISimulatorFactory *factory = getPluginById(pluginId); + ISimulatorFactory *factory = getFactory(pluginId); if (!factory) { + CLogMessage(this).warning("Could not load plugin %1.") << pluginId; m_plugins.remove(pluginId); return nullptr; } diff --git a/src/blackcore/pluginmanagersimulator.h b/src/blackcore/pluginmanagersimulator.h index c22b02e9e..cd499ef99 100644 --- a/src/blackcore/pluginmanagersimulator.h +++ b/src/blackcore/pluginmanagersimulator.h @@ -46,6 +46,7 @@ namespace BlackCore //! Create simulator listener from the plugin //! In case one is existing already, it is returned instead. + //! Returns nullptr if no listener could be created. ISimulatorListener *createListener(const QString &pluginId); //! Get previously created simulator listener from the plugin