From 3bad01a704f7351d0757654d172c5cf6156da83f Mon Sep 17 00:00:00 2001 From: Henry Cheng <39224097+jazzysoggy@users.noreply.github.com> Date: Sun, 17 Jul 2022 03:12:29 -0400 Subject: [PATCH] Fix #17553: Crash when moving invention list items to empty list (#17555) * Fix content check * Add change log entry Co-authored-by: Duncan --- contributors.md | 1 + distribution/changelog.txt | 1 + src/openrct2-ui/windows/EditorInventionsList.cpp | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/contributors.md b/contributors.md index 2b85e7772d..e43dcf1044 100644 --- a/contributors.md +++ b/contributors.md @@ -194,6 +194,7 @@ The following people are not part of the development team, but have been contrib * Erik Wouters (EWouters) * Hoby R. (hobyr) * Huu Kim Nguyen (CoderUndefined) +* Henry Cheng (jazzysoggy) ## Toolchain * (Balletie) - macOS diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 587edd303b..77157555c1 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -7,6 +7,7 @@ - Fix: [#16476] The game sometimes crashes when demolishing a maze. - Fix: [#17444] “Manta Ray” boats slowed down too much in “Ayers Rock” scenario (original bug). - Fix: [#17503] Parks with staff with an ID of 0 have all staff windows focus on that staff +- Fix: [#17553] Crash when moving invention list items to empty list 0.4.1 (2022-07-04) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 2d4f7a9567..829c375add 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -618,7 +618,7 @@ public: { res = inventionListWindow->GetResearchItemAt(newScreenCoords); newScreenCoords.y += LIST_ROW_HEIGHT; - } while (res.has_value() && res->research->IsAlwaysResearched()); + } while (res.has_value() && res->research != nullptr && res->research->IsAlwaysResearched()); if (res.has_value()) {