mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
RTech: fix bug when string is NULL
Fixes a crash because string can be NULL when this is called
This commit is contained in:
parent
f2e49c8a4a
commit
b92c2daea1
@ -15,11 +15,16 @@ int FS_OpenAsyncFile(const char* const filePath, const int logLevel, size_t* con
|
||||
const CHAR* fileToLoad = filePath;
|
||||
char overridePath[1024];
|
||||
|
||||
// is this a pak file and do we have an override
|
||||
if (strstr(fileToLoad, PLATFORM_PAK_PATH) &&
|
||||
Pak_FileOverrideExists(fileToLoad, overridePath, sizeof(overridePath)))
|
||||
// function can be called with null strings, for example if optional
|
||||
// streaming sets are missing; check for it
|
||||
if (fileToLoad && *fileToLoad)
|
||||
{
|
||||
fileToLoad = overridePath;
|
||||
// is this a pak file and do we have an override
|
||||
if (strstr(fileToLoad, PLATFORM_PAK_PATH) &&
|
||||
Pak_FileOverrideExists(fileToLoad, overridePath, sizeof(overridePath)))
|
||||
{
|
||||
fileToLoad = overridePath;
|
||||
}
|
||||
}
|
||||
|
||||
const HANDLE hFile = CreateFileA(fileToLoad, GENERIC_READ,
|
||||
|
Loading…
x
Reference in New Issue
Block a user