mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
Don't assert if CPluginManagerSimulator::createListener returns nullptr
CPluginManagerSimulator::createListener returns nullptr if no listener could be created, e.g. because the plugin could not be loaded due to missing dependencies. Handle this scenario properly instead of raising an assert. refs #669
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "blackcore/pluginmanagersimulator.h"
|
||||
#include "blackcore/simulator.h"
|
||||
#include "blackmisc/directoryutils.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
@@ -42,9 +43,10 @@ namespace BlackCore
|
||||
PluginExtended &plugin = m_plugins[pluginId];
|
||||
if (!plugin.listener)
|
||||
{
|
||||
ISimulatorFactory *factory = getPluginById<ISimulatorFactory>(pluginId);
|
||||
ISimulatorFactory *factory = getFactory(pluginId);
|
||||
if (!factory)
|
||||
{
|
||||
CLogMessage(this).warning("Could not load plugin %1.") << pluginId;
|
||||
m_plugins.remove(pluginId);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user