From 7b7e2e2c21f7be56eec50acfff0207687d68e410 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 28 Feb 2020 22:45:09 +0100 Subject: [PATCH] Check whether LoadLibrary has failed Because that too can happen. --- src/wine-host/bridge.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wine-host/bridge.cpp b/src/wine-host/bridge.cpp index f0d129a2..03545418 100644 --- a/src/wine-host/bridge.cpp +++ b/src/wine-host/bridge.cpp @@ -14,6 +14,10 @@ Bridge::Bridge(std::string plugin_dll_path, std::string socket_endpoint_path) socket_endpoint(socket_endpoint_path), host_vst_dispatch(io_context) { // Got to love these C APIs + if (plugin_handle == nullptr) { + throw std::runtime_error("Could not load a shared library at '" + + plugin_dll_path + "'."); + } // VST plugin entry point functions should be called `VSTPluginMain`, but // there are some older deprecated names that legacy plugins may still use