mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-02-11 23:08:38 -06:00
fix: Crash when deleting items from file combiner in some cases
This commit is contained in:
@@ -1031,14 +1031,20 @@ namespace hex::plugin::builtin {
|
||||
}, "", true);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginDisabled(files.empty() || selectedIndex >= files.size());
|
||||
if (ImGui::Button("hex.builtin.tools.file_tools.combiner.delete"_lang)) {
|
||||
files.erase(files.begin() + selectedIndex);
|
||||
selectedIndex--;
|
||||
|
||||
if (selectedIndex > 0)
|
||||
selectedIndex--;
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginDisabled(files.empty());
|
||||
if (ImGui::Button("hex.builtin.tools.file_tools.combiner.clear"_lang)) {
|
||||
files.clear();
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user