Guard bottom toolbar resizing to prevent nullptr deref (#26994)

This commit is contained in:
Aaron van Geffen authored and GitHub committed 2026-08-26 11:02:47 +00:00
1 parent 79be249f71
commit 63a787c2ae
1 file changed
+7 -1
+7 -1
View File
@@ -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)