From a33c7135d123ccf99d9d3ce86668963e924f8771 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 1 May 2023 14:15:00 +0200 Subject: [PATCH] fix: Crash when closing some popups --- main/source/window/window.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } } }