Fix #16343: Crash in Ride::PopulateVehicleTypeDropdown()

This commit is contained in:
Michael Steenbeek 2022-01-01 15:07:42 +01:00 committed by GitHub
parent c2b33e3541
commit 875115ec33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -2115,7 +2115,9 @@ static void PopulateVehicleTypeDropdown(Ride* ride, bool forceRefresh)
auto& rideEntries = objManager.GetAllRideEntries(rideTypeIterator);
for (auto rideEntryIndex : rideEntries)
{
auto currentRideEntry = get_ride_entry(rideEntryIndex);
const auto* currentRideEntry = get_ride_entry(rideEntryIndex);
if (currentRideEntry == nullptr)
continue;
// Skip if vehicle type has not been invented yet
if (!ride_entry_is_invented(rideEntryIndex) && !gCheatsIgnoreResearchStatus)