Commit 8fbf2487 authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr
Browse files

Ensure factory to exist before accessing.

parent 0d19dee9
...@@ -65,6 +65,10 @@ public: ...@@ -65,6 +65,10 @@ public:
qCCritical(LIBSOUND_LOG) << "Error while loading plugin: " << metadata.name(); qCCritical(LIBSOUND_LOG) << "Error while loading plugin: " << metadata.name();
} }
KPluginFactory *factory = KPluginLoader(loader.fileName()).factory(); KPluginFactory *factory = KPluginLoader(loader.fileName()).factory();
if (!factory) {
qCCritical(LIBSOUND_LOG) << "Could not load plugin: " << metadata.name();
continue;
}
BackendInterface *plugin = factory->create<BackendInterface>(parent, QList< QVariant >()); BackendInterface *plugin = factory->create<BackendInterface>(parent, QList< QVariant >());
if (plugin->captureBackend()) { if (plugin->captureBackend()) {
m_backendList.append(plugin->captureBackend()); m_backendList.append(plugin->captureBackend());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment