From 63a787c2ae68478c11ceaefe91b01fec16b3eeac Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Wed, 26 Aug 2026 13:02:47 +0200 Subject: [PATCH] Guard bottom toolbar resizing to prevent nullptr deref (#26994) --- src/openrct2/interface/Window.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 487cce5992..ac318e8b81 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -763,12 +763,18 @@ static constexpr float kWindowScrollLocations[][2] = { } WindowBase* bottomWind = windowMgr->FindByClass(WindowClass::bottomToolbar); - if (bottomWind != nullptr) + if (bottomWind != nullptr && parkInfoPanel != nullptr && dateInfoPanel != nullptr) { bottomWind->width = std::max(640, width) - parkInfoPanel->width - dateInfoPanel->width; bottomWind->windowPos.x = parkInfoPanel->width; bottomWind->windowPos.y = height - 32; } + else if (bottomWind != nullptr) + { + bottomWind->width = std::max(640, width); + bottomWind->windowPos.x = 0; + bottomWind->windowPos.y = height - 32; + } } static void WindowResizeGuiTitleScreen(const int32_t width, const int32_t height)