fix: Bad optional access when inspectors.hexpat is missing (#761)

This commit is contained in:
Marcelo Conceição 2022-10-02 05:28:37 -03:00 committed by GitHub
parent 3367237da3
commit 62eb0ccd1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -112,9 +112,13 @@ namespace hex::plugin::builtin {
this->m_cachedData.push_back(cacheEntry);
}
} else {
auto error = runtime.getError().value();
const auto& error = runtime.getError();
log::error("Failed to execute inspectors.hexpat:\n {}", error.what());
if (error.has_value()) {
log::error("Failed to execute inspectors.hexpat:\n {}", error.value().what());
} else {
log::error("Failed to execute inspectors.hexpat");
}
}
}