1
0
mirror of synced 2024-11-24 15:50:16 +01:00

fix: Crash when deleting items from file combiner in some cases

This commit is contained in:
WerWolv 2023-08-19 19:18:57 +02:00
parent 83e42ddfd9
commit d50fb8d17b

View File

@ -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();