From 1423ab779a5a47190f72e04449690e184efc8a36 Mon Sep 17 00:00:00 2001 From: jcranston Date: Wed, 5 Aug 2026 19:15:54 +0200 Subject: [PATCH] Fix #26811: Crash when a ride points to a non-existing station object --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/Ride.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index f086c07064..7e33a10539 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -3,6 +3,7 @@ - Improved: [#26099] The ride type selection cheat has been moved into the ride operations tab. - Improved: [#26099] The ride visiblity cheat has been moved into the ride colour/appearance tab. - Fix: [#25169] The convert command strips custom objects from the resulting park. +- Fix: [#26811] Crash when a ride points to a non-existing station object. 0.5.4 (2026-08-02) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index c14612e735..a0324e4a38 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -5211,6 +5211,9 @@ namespace OpenRCT2::Ui::Windows // Draw entrance label auto* stationObj = ride->getStationObject(); + if (stationObj == nullptr) + return; + Formatter ft; ft.Add(stationObj->NameStringId); drawTextEllipsised(clippedRT, { 19, 1 }, widget.width() - 12 - 19, STR_WINDOW_COLOUR_2_STRINGID, ft);