mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix NULL checks in facility_paint_setup
This commit is contained in:
parent
b12dad5bd9
commit
fb74d12f31
|
@ -36,11 +36,17 @@ static void facility_paint_setup(paint_session * session, uint8 rideIndex, uint8
|
|||
|
||||
Ride * ride = get_ride(rideIndex);
|
||||
rct_ride_entry * rideEntry = get_ride_entry(ride->subtype);
|
||||
rct_ride_entry_vehicle * firstVehicleEntry = &rideEntry->vehicles[0];
|
||||
|
||||
if (rideEntry == NULL || firstVehicleEntry == NULL)
|
||||
if (rideEntry == nullptr)
|
||||
{
|
||||
log_error("Error drawing facility, rideEntry or firstVehicleEntry is NULL.");
|
||||
log_error("Error drawing facility, rideEntry is NULL.");
|
||||
return;
|
||||
}
|
||||
|
||||
rct_ride_entry_vehicle * firstVehicleEntry = &rideEntry->vehicles[0];
|
||||
if (firstVehicleEntry == nullptr)
|
||||
{
|
||||
log_error("Error drawing facility, firstVehicleEntry is NULL.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue