Fix #14239: NPE in peep_find_ride_to_look_at() (#14243)

This commit is contained in:
Michael Steenbeek 2021-03-06 17:18:16 +01:00 committed by GitHub
parent 966129dd7c
commit 58c3426747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -6353,7 +6353,8 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, uint8_t* rideToV
if (tileElement->GetType() == TILE_ELEMENT_TYPE_LARGE_SCENERY)
{
if (!(tileElement->AsLargeScenery()->GetEntry()->large_scenery.flags & LARGE_SCENERY_FLAG_PHOTOGENIC))
const auto* entry = tileElement->AsLargeScenery()->GetEntry();
if (entry == nullptr || !(entry->large_scenery.flags & LARGE_SCENERY_FLAG_PHOTOGENIC))
{
continue;
}