Add some nullptr handling
This commit is contained in:
+2
-2
@@ -477,7 +477,7 @@ bool Song::ReloadFromSongDir( RString sDir )
|
|||||||
return false;
|
return false;
|
||||||
copy.RemoveAutoGenNotes();
|
copy.RemoveAutoGenNotes();
|
||||||
*this = copy;
|
*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
|
/* 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
|
* (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.
|
// Reapply the Group Offset if the steps have their own timing data.
|
||||||
if( mNewSteps[id]->m_Timing.empty() )
|
if( mNewSteps[id]->m_Timing.empty() )
|
||||||
continue;
|
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...
|
// Now we wipe out the new pointers, which were shallow copied and not deep copied...
|
||||||
|
|||||||
@@ -581,6 +581,11 @@ bool SongManager::IsGroupNeverCached(const RString& group) const
|
|||||||
RString SongManager::GetSongGroupBannerPath( RString sSongGroup ) const
|
RString SongManager::GetSongGroupBannerPath( RString sSongGroup ) const
|
||||||
{
|
{
|
||||||
Group* group = GetGroupFromName(sSongGroup);
|
Group* group = GetGroupFromName(sSongGroup);
|
||||||
|
if(group == nullptr)
|
||||||
|
{
|
||||||
|
ASSERT_M( 0, ssprintf("requested banner for song group '%s' that doesn't exist",sSongGroup.c_str()) );
|
||||||
|
return RString();
|
||||||
|
}
|
||||||
return group->GetBannerPath();
|
return group->GetBannerPath();
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -613,6 +618,7 @@ bool SongManager::HasPackIni(RString sSongGroup) const
|
|||||||
{
|
{
|
||||||
return group->HasPackIni();
|
return group->HasPackIni();
|
||||||
}
|
}
|
||||||
|
ASSERT_M( 0, ssprintf("requested pack.ini for song group '%s' that doesn't exist",sSongGroup.c_str()) );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user