mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-18 04:23:20 +01:00
Check for file existence before releasing config in config_open() (#5712)
This commit is contained in:
committed by
Ted John
parent
04ed2d78d2
commit
1893326b62
@@ -18,6 +18,7 @@
|
||||
#include "../Context.h"
|
||||
#include "../core/Console.hpp"
|
||||
#include "../core/Exception.hpp"
|
||||
#include "../core/File.h"
|
||||
#include "../core/FileStream.hpp"
|
||||
#include "../core/Memory.hpp"
|
||||
#include "../core/Path.hpp"
|
||||
@@ -622,6 +623,11 @@ extern "C"
|
||||
|
||||
bool config_open(const utf8 * path)
|
||||
{
|
||||
if (!File::Exists(path))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
config_release();
|
||||
return Config::ReadFile(path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user