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;
|
MPD::Song *ptr = 0;
|
||||||
auto pl = proxySongList(screen);
|
auto pl = proxySongList(screen);
|
||||||
if (pl)
|
if (pl && !pl.empty())
|
||||||
ptr = pl.currentSong();
|
ptr = pl.currentSong();
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,6 +107,9 @@ void Lyrics::switchTo()
|
|||||||
# endif // HAVE_CURL_CURL_H
|
# endif // HAVE_CURL_CURL_H
|
||||||
|
|
||||||
auto s = currentSong(myScreen);
|
auto s = currentSong(myScreen);
|
||||||
|
if (!s)
|
||||||
|
return;
|
||||||
|
|
||||||
if (SetSong(*s))
|
if (SetSong(*s))
|
||||||
{
|
{
|
||||||
SwitchTo::execute(this);
|
SwitchTo::execute(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user