mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-22 08:20:57 +01:00
frontend_common: Don't load config files that we fail to open
This commit is contained in:
parent
d8f380961e
commit
0b8218d8eb
1 changed files with 10 additions and 0 deletions
|
@ -65,6 +65,11 @@ void Config::WriteToIni() const {
|
|||
fp = fopen(config_loc.c_str(), "wb");
|
||||
#endif
|
||||
|
||||
if (fp == nullptr) {
|
||||
LOG_ERROR(Frontend, "Config file could not be saved!");
|
||||
return;
|
||||
}
|
||||
|
||||
CSimpleIniA::FileWriter writer(fp);
|
||||
const SI_Error rc = config->Save(writer, false);
|
||||
if (rc < 0) {
|
||||
|
@ -91,6 +96,11 @@ void Config::SetUpIni() {
|
|||
}
|
||||
#endif
|
||||
|
||||
if (fp == nullptr) {
|
||||
LOG_ERROR(Frontend, "Config file could not be loaded!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (SI_Error rc = config->LoadFile(fp); rc < 0) {
|
||||
LOG_ERROR(Frontend, "Config file could not be loaded!");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue