diff --git a/src/sdl/i_main.cpp b/src/sdl/i_main.cpp index 90b1a6a96..2efe4126b 100644 --- a/src/sdl/i_main.cpp +++ b/src/sdl/i_main.cpp @@ -202,14 +202,17 @@ static void InitLogging(void) static void init_exchndl() { HMODULE exchndl_module = LoadLibraryA("exchndl.dll"); - if (exchndl_module != NULL) + + if (exchndl_module == NULL) { - using PFN_ExcHndlInit = void(*)(void); - PFN_ExcHndlInit pfnExcHndlInit = reinterpret_cast( - GetProcAddress(exchndl_module, "ExcHndlInit")); - if (pfnExcHndlInit != NULL) - (pfnExcHndlInit)(); + I_Error("exchndl.dll or mgwhelp.dll is missing"); } + + using PFN_ExcHndlInit = void(*)(void); + PFN_ExcHndlInit pfnExcHndlInit = reinterpret_cast( + GetProcAddress(exchndl_module, "ExcHndlInit")); + if (pfnExcHndlInit != NULL) + (pfnExcHndlInit)(); } #endif