From da965cb1adeb698b81c623636b0496e450db178e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 5 Nov 2018 06:25:46 +0100 Subject: [PATCH] Fix #8224: invalid access in peep_find_ride_to_look_at (#8225) * Fix #8224: invalid access in peep_find_ride_to_look_at * Update Guest.cpp --- src/openrct2/peep/Guest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index b8f50772fa96..ac4489f01a95 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -6434,6 +6434,12 @@ static bool peep_find_ride_to_look_at(rct_peep* peep, uint8_t edge, uint8_t* rid // TODO: extract loop A tileElement = surfaceElement; + + if (tileElement == nullptr) + { + return false; + } + do { // Ghosts are purely this-client-side and should not cause any interaction,