diff --git a/src/win/conpty.cc b/src/win/conpty.cc index 83a185fdc..7b286d3d6 100644 --- a/src/win/conpty.cc +++ b/src/win/conpty.cc @@ -428,7 +428,7 @@ static Napi::Value PtyConnect(const Napi::CallbackInfo& info) { HANDLE hLibrary = LoadConptyDll(info, useConptyDll); bool fLoadedDll = hLibrary != nullptr; - if (fLoadedDll) + if (useConptyDll && fLoadedDll) { PFNRELEASEPSEUDOCONSOLE const pfnReleasePseudoConsole = (PFNRELEASEPSEUDOCONSOLE)GetProcAddress( (HMODULE)hLibrary, "ConptyReleasePseudoConsole");