From 6043f583b0355086b7e942f3c05b88b23e3f4122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Thu, 17 Jan 2019 23:39:27 +0100 Subject: [PATCH] Add missing nullptr check in rct_peep::UpdateRideMazePathfinding Fixes https://www.nedesigns.com/park/3359/h2h7-r4-diamondheights/ --- src/openrct2/peep/Guest.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index bb4b238d39..da4cdff6af 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -4779,7 +4779,12 @@ void rct_peep::UpdateRideMazePathfinding() } while (!(tileElement++)->IsLastForTile()); - uint16_t mazeEntry = tileElement->AsTrack()->GetMazeEntry(); + auto trackMazeEntry = tileElement->AsTrack(); + if (trackMazeEntry == nullptr) + { + return; + } + uint16_t mazeEntry = trackMazeEntry->GetMazeEntry(); uint16_t openHedges = 0; // var_37 is 3, 7, 11 or 15