fix: toml without exceptions usage
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
parent
e2a65a7077
commit
2a5d291bd9
2 changed files with 8 additions and 6 deletions
|
@ -104,14 +104,15 @@ ModDetails ReadMCModTOML(QByteArray contents)
|
|||
#if TOML_EXCEPTIONS
|
||||
try {
|
||||
tomlData = toml::parse(contents.toStdString());
|
||||
} catch (const toml::parse_error& err) {
|
||||
} catch ([[maybe_unused]] const toml::parse_error& err) {
|
||||
return {};
|
||||
}
|
||||
#else
|
||||
tomlData = toml::parse(contents.toStdString());
|
||||
if (!tomlData) {
|
||||
toml::parse_result result = toml::parse(contents.toStdString());
|
||||
if (!result) {
|
||||
return {};
|
||||
}
|
||||
tomlData = result.table();
|
||||
#endif
|
||||
|
||||
// array defined by [[mods]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue