Add additional NULL checks just in case

This commit is contained in:
Crash Cringle
2025-03-22 12:02:04 -07:00
committed by teejusb
parent ce7cef6d90
commit 0270cda54d
3 changed files with 20 additions and 9 deletions
+4 -3
View File
@@ -97,10 +97,11 @@ void Profile::ClearSongs()
delete curr_song;
}
m_songs.clear();
LOG->Trace("Profile::ClearSongs()");
if (m_group != nullptr)
{
delete m_group;
RageUtil::SafeDelete( m_group);
}
}
@@ -1235,7 +1236,7 @@ void Profile::LoadSongsFromDir(RString const& dir, ProfileSlot prof_slot, bool i
float load_time= song_load_start_time.Ago();
LOG->Trace("Successfully loaded %zu songs in %.6f from profile.", m_songs.size(), load_time);
if (m_songs.size() <= 0) {
if (m_songs.empty()) {
delete m_group;
m_group = nullptr;
}