1
0
mirror of synced 2024-11-12 02:00:52 +01:00

fix: Crash when deleting last environment variable in pattern editor

This commit is contained in:
WerWolv 2023-05-19 17:15:37 +02:00
parent 7ed153a47b
commit 0f9434740f
2 changed files with 4 additions and 1 deletions

@ -1 +1 @@
Subproject commit 62042c3c782a6f4cf69c5ecc7bbb5a68fdec623c
Subproject commit f0780b7a7625fb17297adfe0baafdbe730a58aa9

View File

@ -341,10 +341,13 @@ namespace hex::plugin::builtin {
{
if (ImGui::IconButton(ICON_VS_REMOVE, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
bool isFirst = iter == envVars.begin();
bool isLast = std::next(iter) == envVars.end();
envVars.erase(iter);
if (isFirst)
iter = envVars.begin();
if (isLast)
iter = std::prev(envVars.end());
}
}
ImGui::EndDisabled();