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

master
Andrzej Rybczak 16 years ago
parent d2f8bb1e9d
commit e8c8e6394e
  1. 8
      src/lyrics.cpp

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

Loading…
Cancel
Save