mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 22:34:33 +01:00
Fix #22479: Crash when a ride has no valid music object
This commit is contained in:
committed by
GitHub
parent
4a890f1c91
commit
558d235680
@@ -19,6 +19,7 @@
|
||||
- Fix: [#22072] Objective date string and staff tenure date string cannot be reused on agglutinative languages.
|
||||
- Fix: [#22133] Ride time is incorrect for extremely slow speeds.
|
||||
- Fix: [#22231] Invalid object version can cause a crash.
|
||||
- Fix: [#22479] Crash when a ride has no valid music object.
|
||||
- Fix: [#22562] Bottom row of pixels is not always drawn by the OpenGL renderer when zoomed in.
|
||||
- Fix: [#22653] Missing water tiles in RCT1 and RCT2 scenarios.
|
||||
- Fix: [#22654] Misplaced scenario elements in RCT1 and RCT2 scenarios.
|
||||
|
||||
@@ -5288,7 +5288,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
// Do we have a preview image to draw?
|
||||
auto musicObj = ride->GetMusicObject();
|
||||
bool hasPreview = musicObj->HasPreview();
|
||||
bool hasPreview = musicObj != nullptr && musicObj->HasPreview();
|
||||
if (!hasPreview)
|
||||
return;
|
||||
|
||||
@@ -5321,6 +5321,9 @@ namespace OpenRCT2::Ui::Windows
|
||||
GfxClear(dpi, paletteIndex);
|
||||
|
||||
auto* musicObj = ride->GetMusicObject();
|
||||
if (musicObj == nullptr)
|
||||
return;
|
||||
|
||||
auto y = 0;
|
||||
|
||||
for (size_t i = 0; i < musicObj->GetTrackCount(); i++)
|
||||
|
||||
Reference in New Issue
Block a user