Add some nullptr handling

This commit is contained in:
Crash Cringle
2025-03-03 23:25:32 -08:00
committed by teejusb
parent ac767b3ce8
commit 53a26f2fa4
2 changed files with 8 additions and 2 deletions
+2 -2
View File
@@ -477,7 +477,7 @@ bool Song::ReloadFromSongDir( RString sDir )
return false;
copy.RemoveAutoGenNotes();
*this = copy;
m_SongTiming.m_fBeat0GroupOffsetInSeconds = SONGMAN->GetGroupFromName(m_sGroupName)->GetSyncOffset();
m_SongTiming.m_fBeat0GroupOffsetInSeconds = SONGMAN->GetGroup(this)->GetSyncOffset();
/* Go through the steps, first setting their Song pointer to this song
* (instead of the copy used above), and constructing a map to let us
@@ -493,7 +493,7 @@ bool Song::ReloadFromSongDir( RString sDir )
// Reapply the Group Offset if the steps have their own timing data.
if( mNewSteps[id]->m_Timing.empty() )
continue;
mNewSteps[id]->m_Timing.m_fBeat0GroupOffsetInSeconds = SONGMAN->GetGroupFromName(m_sGroupName)->GetSyncOffset();
mNewSteps[id]->m_Timing.m_fBeat0GroupOffsetInSeconds = SONGMAN->GetGroup(this)->GetSyncOffset();
}
// Now we wipe out the new pointers, which were shallow copied and not deep copied...