aboutsummaryrefslogtreecommitdiff
path: root/primedev
diff options
context:
space:
mode:
Diffstat (limited to 'primedev')
-rw-r--r--primedev/core/filesystem/rpakfilesystem.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/primedev/core/filesystem/rpakfilesystem.cpp b/primedev/core/filesystem/rpakfilesystem.cpp
index c3e5e74e..e3f2a1be 100644
--- a/primedev/core/filesystem/rpakfilesystem.cpp
+++ b/primedev/core/filesystem/rpakfilesystem.cpp
@@ -484,6 +484,14 @@ HOOK(OpenFileHook, o_pOpenFile,
void*, __fastcall, (const char* pPath, void* pCallback))
// clang-format on
{
+ // NOTE [Fifty]: For some reason some users are getting pPath as null when
+ // loading a server, o_pOpenFile uses CreateFileA and checks
+ // its return value so this is completely safe
+ if (pPath == NULL)
+ {
+ return o_pOpenFile(pPath, pCallback);
+ }
+
fs::path path(pPath);
std::string newPath = "";
fs::path filename = path.filename();