1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Prevent crash when opening a window on invalid ride

This commit is contained in:
Michał Janiszewski
2016-11-06 18:26:02 +01:00
parent 5e85b2e807
commit 512c7bcf51

View File

@@ -1863,7 +1863,7 @@ static void window_ride_init_viewport(rct_window *w)
focus.sprite.sprite_id = ride->vehicles[eax];
rct_ride_entry* ride_entry = get_ride_entry_by_ride(ride);
if (ride_entry->tab_vehicle != 0){
if (ride_entry && ride_entry->tab_vehicle != 0){
rct_vehicle* vehicle = GET_VEHICLE(focus.sprite.sprite_id);
focus.sprite.sprite_id = vehicle->next_vehicle_on_train;
}