lyrics: check if the song exists

This commit is contained in:
Andrzej Rybczak
2014-11-06 19:00:24 +01:00
parent 3e9d25ccea
commit d958e94d75
2 changed files with 4 additions and 1 deletions

View File

@@ -52,7 +52,7 @@ inline MPD::Song *currentSong(BaseScreen *screen)
{
MPD::Song *ptr = 0;
auto pl = proxySongList(screen);
if (pl)
if (pl && !pl.empty())
ptr = pl.currentSong();
return ptr;
}

View File

@@ -107,6 +107,9 @@ void Lyrics::switchTo()
# endif // HAVE_CURL_CURL_H
auto s = currentSong(myScreen);
if (!s)
return;
if (SetSong(*s))
{
SwitchTo::execute(this);