Commit 2272b07d authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Fix crash when ShortUrlEnginePlugin cannot be loaded

parent 97279d24
......@@ -106,8 +106,11 @@ void ShortUrlEnginePluginManagerPrivate::initializePlugins()
void ShortUrlEnginePluginManagerPrivate::loadPlugin(ShortUrlEnginePluginInfo *item)
{
item->plugin = KPluginLoader(item->metaData.fileName()).factory()->create<ShortUrlEnginePlugin>(q, QVariantList() << item->saveName());
item->plugin->setPluginName(item->metaData.name());
KPluginLoader pluginLoader(item->metaData.fileName());
if (pluginLoader.factory()) {
item->plugin = pluginLoader.factory()->create<ShortUrlEnginePlugin>(q, QVariantList() << item->saveName());
item->plugin->setPluginName(item->metaData.name());
}
}
QVector<ShortUrlEnginePlugin *> ShortUrlEnginePluginManagerPrivate::pluginsList() const
......
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