Fix a bug which may cause crash at startup on some platforms

This commit is contained in:
Tindy X committed 2020-03-10 22:40:15 +08:00
1 parent b5e3763978
commit 550670006d
1 file changed
+7 -3
+7 -3
View File
@@ -568,9 +568,13 @@ void readConf()
try
{
YAML::Node yaml = YAML::LoadFile(pref_path);
if(yaml.size() && yaml["common"])
return readYAMLConf(yaml);
std::string prefdata = fileGet(pref_path, false);
if(prefdata.find("common:") != prefdata.npos)
{
YAML::Node yaml = YAML::Load(prefdata);
if(yaml.size() && yaml["common"])
return readYAMLConf(yaml);
}
}
catch (YAML::Exception &e)
{