mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
VpkLib: fix bug in GetManifest()
Check if the parsing was actually successful, else free and return nullptr. The null check at call site never worked since we never return null on failure.
This commit is contained in:
parent
069daff4f0
commit
11fd516b50
@ -189,7 +189,11 @@ static KeyValues* GetManifest(const CUtlString& workspacePath, const CUtlString&
|
||||
outPath.Format("%s%s%s.txt", workspacePath.Get(), "manifest/", manifestFile.Get());
|
||||
|
||||
KeyValues* pManifestKV = new KeyValues("BuildManifest");
|
||||
pManifestKV->LoadFromFile(FileSystem(), outPath.Get(), "PLATFORM");
|
||||
if (!pManifestKV->LoadFromFile(FileSystem(), outPath.Get(), "PLATFORM"))
|
||||
{
|
||||
pManifestKV->DeleteThis();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return pManifestKV;
|
||||
}
|
||||
@ -278,7 +282,7 @@ static bool GetEntryValues(CUtlVector<VPKKeyValues_t>& entryValues,
|
||||
|
||||
if (!pManifestKV)
|
||||
{
|
||||
Warning(eDLL_T::FS, "Invalid VPK build manifest KV; unable to parse entry list\n");
|
||||
Error(eDLL_T::FS, NO_ERROR, "Invalid or missing VPK build manifest KV; unable to parse entry list\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user