From ee7b9ae6b04641fe13073bf5afb424b5c2cba6f9 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 19 Feb 2023 22:20:38 +0100 Subject: [PATCH] Add missing null check --- src/openrct2-ui/windows/StaffList.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index a3c038b81f..c45dbfc9ef 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -528,6 +528,8 @@ private: auto actionResult = res->GetData(); auto* staff = GetEntity(actionResult.StaffEntityId); + if (staff == nullptr) + return; // If autoposition of staff is disabled, pickup peep and then open the staff window if (staff->State == PeepState::Picked)