From 58c3426747d6a638303221e2625c96520227d0b3 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sat, 6 Mar 2021 17:18:16 +0100 Subject: [PATCH] Fix #14239: NPE in peep_find_ride_to_look_at() (#14243) --- src/openrct2/peep/Guest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index d87e5111a8..f95bbfe3f6 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -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; }