mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-30 18:25:16 +01:00
Fix #21641: NPE when creating track iterator from invalid tile element
This commit is contained in:
committed by
GitHub
parent
cb3b2a77e7
commit
74364e2afc
@@ -7,6 +7,7 @@
|
||||
- Fix: [#910] Extra viewport does not preserve the location when rotating.
|
||||
- Fix: [#21434] Number of guests overflows in objective text.
|
||||
- Fix: [#21543] Crash with creating a TrackIterator with invalid arguments.
|
||||
- Fix: [#21641] Crash when creating track iterator from an invalid tile element.
|
||||
|
||||
0.4.9 (2024-03-02)
|
||||
------------------------------------------------------------------------
|
||||
|
||||
@@ -733,6 +733,9 @@ bool TrackTypeIsHelix(track_type_t trackType)
|
||||
|
||||
std::optional<CoordsXYZD> GetTrackSegmentOrigin(const CoordsXYE& posEl)
|
||||
{
|
||||
if (posEl.element == nullptr)
|
||||
return {};
|
||||
|
||||
auto trackEl = posEl.element->AsTrack();
|
||||
if (trackEl == nullptr)
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user