check for emptiness in some more places

these containers can be empty escpecially if one wants to go for a trip
around ncmpcpp screens while connection to mpd is lost. this is highly
unlikely to happen, but should be secured anyway.
This commit is contained in:
Andrzej Rybczak
2010-03-25 00:51:56 +01:00
parent 37c7acfd3c
commit 2583487ffb
4 changed files with 16 additions and 7 deletions

View File

@@ -280,6 +280,8 @@ MPD::Song *Playlist::CurrentSong()
void Playlist::GetSelectedSongs(MPD::SongList &v)
{
if (myPlaylist->Items->Empty())
return;
std::vector<size_t> selected;
Items->GetSelected(selected);
if (selected.empty())