From f1339f8b4a20acee5aa1d7a7690ae3216d28318d Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 4 Jan 2021 13:52:49 +0100 Subject: [PATCH] Fixed crash on load when no plugin folder was present --- source/window.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/window.cpp b/source/window.cpp index a123b64c8..1f2f38f59 100644 --- a/source/window.cpp +++ b/source/window.cpp @@ -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());