lyrics: fix segfault if song didn't have proper tags set

This commit is contained in:
Andrzej Rybczak
2010-09-30 05:15:25 +02:00
parent d2f8bb1e9d
commit e8c8e6394e

View File

@@ -111,16 +111,18 @@ void Lyrics::SwitchTo()
if (const MPD::Song *s = myScreen->CurrentSong())
{
myOldScreen = myScreen;
myScreen = this;
if (!s->GetArtist().empty() && !s->GetTitle().empty())
{
myOldScreen = myScreen;
myScreen = this;
itsSong = *s;
Load();
}
Global::RedrawHeader = 1;
Global::RedrawHeader = 1;
}
else
ShowMessage("Song must have both artist and title tag set!");
}
}