Fix #14958, e96f35c: Don't use not yet initialised member (#14959)

This commit is contained in:
Loïc Guilloux
2025-12-22 19:21:10 +01:00
committed by dP
parent 1f2e85a52d
commit 313bc63c35

View File

@@ -1352,7 +1352,7 @@ struct StationViewWindow : public Window {
StationViewWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc) StationViewWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
{ {
this->CreateNestedTree(); this->CreateNestedTree();
this->GetWidget<NWidgetStacked>(WID_SV_CLOSE_AIRPORT_SEL)->SetDisplayedPlane(Station::Get(this->window_number)->facilities.Test(StationFacility::Airport) ? 0 : SZSP_NONE); this->GetWidget<NWidgetStacked>(WID_SV_CLOSE_AIRPORT_SEL)->SetDisplayedPlane(Station::Get(window_number)->facilities.Test(StationFacility::Airport) ? 0 : SZSP_NONE);
this->vscroll = this->GetScrollbar(WID_SV_SCROLLBAR); this->vscroll = this->GetScrollbar(WID_SV_SCROLLBAR);
/* Nested widget tree creation is done in two steps to ensure that this->GetWidget<NWidgetCore>(WID_SV_ACCEPTS_RATINGS) exists in UpdateWidgetSize(). */ /* Nested widget tree creation is done in two steps to ensure that this->GetWidget<NWidgetCore>(WID_SV_ACCEPTS_RATINGS) exists in UpdateWidgetSize(). */
this->FinishInitNested(window_number); this->FinishInitNested(window_number);