Fix crash in FerrisWheel paint

[OpenRCT2/OpenRCT2#8662]
This commit is contained in:
Xkeeper 2019-02-05 11:14:17 -08:00
parent a22260b56a
commit 2828cbb2fc
No known key found for this signature in database
GPG Key ID: 397C04773ABE4045
1 changed files with 5 additions and 0 deletions

View File

@ -57,6 +57,11 @@ static void paint_ferris_wheel_structure(
Ride* ride = get_ride(rideIndex);
rct_ride_entry* rideEntry = get_ride_entry(ride->subtype);
rct_vehicle* vehicle = nullptr;
if (rideEntry == nullptr)
{
log_error("Error drawing Ferris Wheel, rideEntry is NULL.");
return;
}
int8_t xOffset = !(direction & 1) ? axisOffset : 0;
int8_t yOffset = (direction & 1) ? axisOffset : 0;