From d988b92b384c762b0ef2a31055430d400745afa9 Mon Sep 17 00:00:00 2001 From: Corantin H Date: Fri, 2 Feb 2024 22:14:56 +0100 Subject: [PATCH] Check selected quad index when rendering quad popup (fixes #7904) --- src/game/editor/popups.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/game/editor/popups.cpp b/src/game/editor/popups.cpp index 3e367944a..621719628 100644 --- a/src/game/editor/popups.cpp +++ b/src/game/editor/popups.cpp @@ -828,6 +828,8 @@ CUI::EPopupMenuFunctionResult CEditor::PopupQuad(void *pContext, CUIRect View, b { CEditor *pEditor = static_cast(pContext); std::vector vpQuads = pEditor->GetSelectedQuads(); + if(pEditor->m_SelectedQuadIndex < 0 || pEditor->m_SelectedQuadIndex >= (int)vpQuads.size()) + return CUI::POPUP_CLOSE_CURRENT; CQuad *pCurrentQuad = vpQuads[pEditor->m_SelectedQuadIndex]; std::shared_ptr pLayer = std::static_pointer_cast(pEditor->GetSelectedLayerType(0, LAYERTYPE_QUADS));