fix: Error when opening a file

This commit is contained in:
WerWolv
2021-12-12 21:46:48 +01:00
parent b372d20ab0
commit 9bf9788689
5 changed files with 16 additions and 14 deletions

View File

@@ -481,7 +481,7 @@ namespace hex::plugin::builtin {
saveAs();
}
if (ImGui::MenuItem("hex.builtin.view.hexeditor.menu.file.close"_lang, "", false, providerValid && provider->isAvailable())) {
if (ImGui::MenuItem("hex.builtin.view.hexeditor.menu.file.close"_lang, "", false, providerValid)) {
EventManager::post<EventFileUnloaded>();
ImHexApi::Provider::remove(ImHexApi::Provider::get());
providerValid = false;
@@ -728,6 +728,8 @@ namespace hex::plugin::builtin {
fileProvider->setPath(path);
if (!fileProvider->open()) {
View::showErrorPopup("hex.builtin.view.hexeditor.error.open"_lang);
ImHexApi::Provider::remove(provider);
return;
}
}