Fix #14067: Nullptr exception in vehicle measurement code

This commit is contained in:
Duncan 2021-02-11 08:49:13 +00:00 committed by GitHub
parent fe8b8280e8
commit 14cca95fec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1886,6 +1886,9 @@ void Vehicle::UpdateMeasurements()
continue; continue;
rct_scenery_entry* scenery = tileElement->AsSmallScenery()->GetEntry(); rct_scenery_entry* scenery = tileElement->AsSmallScenery()->GetEntry();
if (scenery == nullptr)
continue;
if (scenery_small_entry_has_flag(scenery, SMALL_SCENERY_FLAG_FULL_TILE)) if (scenery_small_entry_has_flag(scenery, SMALL_SCENERY_FLAG_FULL_TILE))
{ {
coverFound = true; coverFound = true;