Skip to content

Commit

Permalink
don't try to add unloaded charts to a playlist group, it'll crash
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jun 7, 2017
1 parent dd59276 commit bdfd39d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/SongManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ void Playlist::LoadFromNode(const XNode* node) {

vector<Song*> playlistgroup;
for (auto& n : chartlist)
playlistgroup.emplace_back(SONGMAN->GetSongByChartkey(n.key));
if(n.loaded)
playlistgroup.emplace_back(SONGMAN->GetSongByChartkey(n.key));

SONGMAN->groupderps[name] = playlistgroup;
}
Expand Down Expand Up @@ -391,7 +392,8 @@ void SongManager::MakePlaylistFromFavorites(set<string>& favs) {

vector<Song*> playlistgroup;
for (auto& n : pl.chartlist)
playlistgroup.emplace_back(SONGMAN->GetSongByChartkey(n.key));
if(n.loaded)
playlistgroup.emplace_back(SONGMAN->GetSongByChartkey(n.key));

SONGMAN->groupderps["Favorites"] = playlistgroup;
SongUtil::SortSongPointerArrayByTitle(groupderps["Favorites"]);
Expand Down

0 comments on commit bdfd39d

Please sign in to comment.