1
0
mirror of synced 2025-01-18 00:56:49 +01:00

fix: Crash when opening a file that cannot be mapped into memory

This commit is contained in:
WerWolv 2023-12-31 14:58:20 +01:00
parent 8cb833eca9
commit 4a5f1038e0
2 changed files with 6 additions and 2 deletions

@ -1 +1 @@
Subproject commit d25459dfa8e706af938427e979e454a8326c5984
Subproject commit b3665a698d3484a992d820051d93286af750decf

View File

@ -232,7 +232,11 @@ namespace hex::plugin::builtin {
m_fileStats = file.getFileInfo();
m_file = std::move(file);
m_file.map();
if (!m_file.map()) {
this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), ::strerror(errno)));
return false;
}
m_fileSize = m_file.getSize();
m_file.close();