Fixed crash on load when no plugin folder was present

This commit is contained in:
WerWolv 2021-01-04 13:52:49 +01:00
parent eed7ef1ac3
commit f1339f8b4a
1 changed files with 4 additions and 1 deletions

View File

@ -376,7 +376,10 @@ namespace hex {
}
void Window::initPlugins() {
PluginHandler::load((std::filesystem::path(mainArgv[0]).parent_path() / "plugins").string());
try {
auto pluginFolderPath = std::filesystem::path(mainArgv[0]).parent_path() / "plugins";
PluginHandler::load(pluginFolderPath.string());
} catch (std::runtime_error &e) { return; }
for (const auto &plugin : PluginHandler::getPlugins()) {
plugin.initializePlugin(SharedData::get());