Prevent out of bounds access, prevents assert on debug builds

This commit is contained in:
ζeh Matt committed 2025-01-23 11:00:30 +02:00
1 parent f70d202cf0
commit 9138fba9cf
1 file changed
+1 -1
+1 -1
View File
@@ -961,7 +961,7 @@ namespace OpenRCT2
{
windowClass = w->classification;
windowNumber = w->number;
widget = &w->widgets[widgetIndex];
widget = widgetIndex == kWidgetIndexNull ? nullptr : &w->widgets[widgetIndex];
}
InputWidgetOverChangeCheck(windowClass, windowNumber, widgetIndex);