diff --git a/main/source/window/window.cpp b/main/source/window/window.cpp index 9b90d3e11..1f28766bf 100644 --- a/main/source/window/window.cpp +++ b/main/source/window/window.cpp @@ -585,7 +585,8 @@ namespace hex { log::debug("Closing popup '{}'", name); positionSet = sizeSet = false; - popups.erase(std::find(popups.begin(), popups.end(), currPopup)); + if (auto it = std::find(popups.begin(), popups.end(), currPopup); it != popups.end()) + popups.erase(it); } } }