PLUGINS: Fix crash when no plugins are available
This commit is contained in:
parent
a0c15492b4
commit
e2d91258b7
2 changed files with 22 additions and 17 deletions
|
@ -641,15 +641,18 @@ const Plugin *EngineManager::findPlugin(const Common::String &engineId) const {
|
|||
}
|
||||
|
||||
// We failed to find it using the engine ID. Scan the list of plugins
|
||||
PluginMan.loadFirstPlugin();
|
||||
do {
|
||||
plugin = findLoadedPlugin(engineId);
|
||||
if (plugin) {
|
||||
// Update with new plugin file name
|
||||
PluginMan.updateConfigWithFileName(engineId);
|
||||
return plugin;
|
||||
}
|
||||
} while (PluginMan.loadNextPlugin());
|
||||
const PluginList &plugins = getPlugins();
|
||||
if (!plugins.empty()) {
|
||||
PluginMan.loadFirstPlugin();
|
||||
do {
|
||||
plugin = findLoadedPlugin(engineId);
|
||||
if (plugin) {
|
||||
// Update with new plugin file name
|
||||
PluginMan.updateConfigWithFileName(engineId);
|
||||
return plugin;
|
||||
}
|
||||
} while (PluginMan.loadNextPlugin());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue