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

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");
}
}
}