diff options
author | rubidium <rubidium@openttd.org> | 2013-11-26 13:23:31 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-11-26 13:23:31 +0000 |
commit | 79ccf48636c5290b453dccc9bfec660b9ba073ef (patch) | |
tree | 22bc6d7ab669a10cae00d62a295eaf7d866e3422 | |
parent | 50fdf5e30cd59090fb6600f0fbae8888c43ca7ee (diff) | |
download | openttd-79ccf48636c5290b453dccc9bfec660b9ba073ef.tar.xz |
(svn r26122) -Fix-ish: remove essentially dead code; if nested_array were NULL there, it would segfault in RaiseWidget
-rw-r--r-- | src/window.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/window.cpp b/src/window.cpp index 81738aec3..e21edfc73 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -268,13 +268,9 @@ void Window::OnDropdownClose(Point pt, int widget, int index, bool instant_close } /* Raise the dropdown button */ - if (this->nested_array != NULL) { - NWidgetCore *nwi2 = this->GetWidget<NWidgetCore>(widget); - if ((nwi2->type & WWT_MASK) == NWID_BUTTON_DROPDOWN) { - nwi2->disp_flags &= ~ND_DROPDOWN_ACTIVE; - } else { - this->RaiseWidget(widget); - } + NWidgetCore *nwi2 = this->GetWidget<NWidgetCore>(widget); + if ((nwi2->type & WWT_MASK) == NWID_BUTTON_DROPDOWN) { + nwi2->disp_flags &= ~ND_DROPDOWN_ACTIVE; } else { this->RaiseWidget(widget); } |