Skip to content

Commit

Permalink
starting an empty playlist as a course would crash
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 28, 2017
1 parent f77f5ba commit bb64dbd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ScreenSelectMusic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1902,6 +1902,10 @@ class LunaScreenSelectMusic: public Luna<ScreenSelectMusic>
SONGMAN->playlistcourse = SArg(1);
Playlist& pl = SONGMAN->allplaylists[SONGMAN->playlistcourse];

// don't allow empty playlists to be started as a course
if (pl.chartlist.empty())
return 1;

// dont allow playlists with an unloaded chart to be played as a course
FOREACH(Chart, pl.chartlist, ch)
if (!ch->loaded)
Expand Down

0 comments on commit bb64dbd

Please sign in to comment.