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

@@ -110,18 +110,20 @@ void Lyrics::SwitchTo()
# endif // HAVE_CURL_CURL_H
if (const MPD::Song *s = myScreen->CurrentSong())
{
if (!s->GetArtist().empty() && !s->GetTitle().empty())
{
myOldScreen = myScreen;
myScreen = this;
if (!s->GetArtist().empty() && !s->GetTitle().empty())
{
itsSong = *s;
Load();
}
Global::RedrawHeader = 1;
}
else
ShowMessage("Song must have both artist and title tag set!");
}
}
std::basic_string<my_char_t> Lyrics::Title()