Preserve nullptr if native module name is null or empty.

This commit is contained in:
Andy Fillebrown 2019-04-10 10:58:34 -04:00
parent 3ccc077406
commit 074ff2a093

View file

@ -22,7 +22,8 @@ static QString nativeModule;
static void* getExportedFunction(const char* symbolName) {
#ifdef _WIN32
HMODULE library = GetModuleHandle(nativeModule.toLocal8Bit());
HMODULE library = GetModuleHandle(nativeModule.isNull() || nativeModule.isEmpty() ? nullptr
: nativeModule.toLocal8Bit());
FARPROC symbol = GetProcAddress(library, symbolName);
return (void*)symbol;
#else