Fix LoadGameConfigFile returning valid handle on invalid path
This commit is contained in:
parent
f1a2a00d38
commit
33768740fa
|
@ -24,6 +24,7 @@ static cell AMX_NATIVE_CALL LoadGameConfigFile(AMX *amx, cell *params)
|
|||
|
||||
if (!ConfigManager.LoadGameConfigFile(filename, &config, error, sizeof(error)))
|
||||
{
|
||||
ConfigManager.CloseGameConfigFile(config);
|
||||
LogError(amx, AMX_ERR_NATIVE, "Unable to open %s: %s", filename, error);
|
||||
return 0;
|
||||
}
|
||||
|
@ -31,7 +32,7 @@ static cell AMX_NATIVE_CALL LoadGameConfigFile(AMX *amx, cell *params)
|
|||
int handle = GameConfigHandle.create();
|
||||
|
||||
auto configHandle = GameConfigHandle.lookup(handle);
|
||||
|
||||
|
||||
if (!configHandle)
|
||||
{
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user