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()) if (const MPD::Song *s = myScreen->CurrentSong())
{ {
myOldScreen = myScreen;
myScreen = this;
if (!s->GetArtist().empty() && !s->GetTitle().empty()) if (!s->GetArtist().empty() && !s->GetTitle().empty())
{ {
myOldScreen = myScreen;
myScreen = this;
itsSong = *s; itsSong = *s;
Load(); Load();
Global::RedrawHeader = 1;
} }
else
Global::RedrawHeader = 1; ShowMessage("Song must have both artist and title tag set!");
} }
} }