Skip to content

Commit

Permalink
Fixed crash on load when no plugin folder was present
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Jan 4, 2021
1 parent eed7ef1 commit f1339f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit f1339f8

Please sign in to comment.