Skip to content

Commit 651cea5

Browse files
committed
Part 2 of "Rewrite crash handler" (after ca5ca19)
1 parent 7a89e59 commit 651cea5

20 files changed

+3906
-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)
@@ -992,7 +993,11 @@ T* InitModule(CModuleLoader& m_Loader, const SString& strName, const SString& st
992993
}
993994

994995
// If we have a valid initializer, call it.
995-
T* pResult = pfnInit(pObj);
996+
T* pResult = nullptr;
997+
if (pfnInit != nullptr)
998+
{
999+
pResult = pfnInit(pObj);
1000+
}
9961001

9971002
// Restore current directory
9981003
SetCurrentDirectory(strSavedCwd);

0 commit comments

Comments
 (0)