Fix #21641: NPE when creating track iterator from invalid tile element

This commit is contained in:
Michael Steenbeek 2024-03-22 02:51:11 +01:00 committed by GitHub
parent cb3b2a77e7
commit 74364e2afc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -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)
------------------------------------------------------------------------

View File

@ -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 {};