From 6a97bbd4c3bd31cb5d9713f75cb04dcdec5d4768 Mon Sep 17 00:00:00 2001 From: historic_bruno Date: Fri, 4 Oct 2013 00:31:36 +0000 Subject: [PATCH] Fixes dropdowns opening with empty list, caused assertion failure about vector subscript range in MSVC debug build This was SVN commit r13936. --- source/gui/CDropDown.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/gui/CDropDown.cpp b/source/gui/CDropDown.cpp index 9001d1afd3..f3b82b40fd 100644 --- a/source/gui/CDropDown.cpp +++ b/source/gui/CDropDown.cpp @@ -182,6 +182,11 @@ void CDropDown::HandleMessage(SGUIMessage &Message) if (!m_Open) { + CGUIList *pList; + GUI::GetSettingPointer(this, "list", pList); + if (pList->m_Items.empty()) + return; + m_Open = true; GetScrollBar(0).SetZ(GetBufferedZ()); GUI::GetSetting(this, "selected", m_ElementHighlight);