lyrics: check if the song exists
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user