1
0
Fork 0

Fix 0de7fd3c24: widget_lookup may contain non-NWidgetCore widgets.

pull/13787/head
Peter Nelson 2025-03-09 19:08:29 +00:00
parent 0de7fd3c24
commit dd0084012e
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 1 additions and 2 deletions

View File

@ -530,8 +530,7 @@ void Window::RaiseButtons(bool autoraise)
for (auto &pair : this->widget_lookup) {
WidgetType type = pair.second->type;
NWidgetCore *wid = dynamic_cast<NWidgetCore *>(pair.second);
assert(wid != nullptr);
if (((type & ~WWB_PUSHBUTTON) < WWT_LAST || type == NWID_PUSHBUTTON_DROPDOWN) &&
if (wid != nullptr && ((type & ~WWB_PUSHBUTTON) < WWT_LAST || type == NWID_PUSHBUTTON_DROPDOWN) &&
(!autoraise || (type & WWB_PUSHBUTTON) || type == WWT_EDITBOX) && wid->IsLowered()) {
wid->SetLowered(false);
wid->SetDirty(this);