fix: toml without exceptions usage

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers
2023-07-01 13:38:32 -07:00
parent e2a65a7077
commit 2a5d291bd9
2 changed files with 8 additions and 6 deletions

View File

@ -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]]