1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00

Fix #20121: Guard against nullptr on viewport scroll (#20122)

This commit is contained in:
Matthias Moninger
2023-05-03 22:15:02 +03:00
committed by GitHub
parent 530dfac7c9
commit e9c480c66e

View File

@@ -1646,7 +1646,12 @@ bool InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER modifier)
void InputScrollViewport(const ScreenCoordsXY& scrollScreenCoords)
{
WindowBase* mainWindow = WindowGetMain();
if (mainWindow == nullptr)
return;
Viewport* viewport = mainWindow->viewport;
if (viewport == nullptr)
return;
const int32_t speed = gConfigGeneral.EdgeScrollingSpeed;