Skip to content

Commit 47bb4bc

Browse files
committed
Part 2 of "Rewrite crash handler" (after ca5ca19)
1 parent aff7041 commit 47bb4bc

20 files changed

+3905
-1169
lines changed

Client/core/CCore.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <ServerBrowser/CServerCache.h>
2828
#include "CDiscordRichPresence.h"
2929
#include "CSteamClient.h"
30+
#include "CCrashDumpWriter.h"
3031

3132
using SharedUtil::CalcMTASAPath;
3233
using namespace std;
@@ -44,7 +45,7 @@ extern fs::path g_gtaDirectory;
4445
template <>
4546
CCore* CSingleton<CCore>::m_pSingleton = NULL;
4647

47-
static auto Win32LoadLibraryA = static_cast<decltype(&LoadLibraryA)>(nullptr);
48+
static auto Win32LoadLibraryA = LoadLibraryA;
4849
static constexpr long long TIME_DISCORD_UPDATE_RICH_PRESENCE_RATE = 10000;
4950

5051
static HMODULE WINAPI SkipDirectPlay_LoadLibraryA(LPCSTR fileName)
@@ -968,7 +969,11 @@ T* InitModule(CModuleLoader& m_Loader, const SString& strName, const SString& st
968969
}
969970

970971
// If we have a valid initializer, call it.
971-
T* pResult = pfnInit(pObj);
972+
T* pResult = nullptr;
973+
if (pfnInit != nullptr)
974+
{
975+
pResult = pfnInit(pObj);
976+
}
972977

973978
// Restore current directory
974979
SetCurrentDirectory(strSavedCwd);

0 commit comments

Comments
 (0)