fix: Crash when deleting last environment variable in pattern editor
This commit is contained in:
parent
7ed153a47b
commit
0f9434740f
2
lib/external/pattern_language
vendored
2
lib/external/pattern_language
vendored
@ -1 +1 @@
|
||||
Subproject commit 62042c3c782a6f4cf69c5ecc7bbb5a68fdec623c
|
||||
Subproject commit f0780b7a7625fb17297adfe0baafdbe730a58aa9
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user