actions: jump to playing song: enter run() even if there is no playing song

This commit is contained in:
Andrzej Rybczak
2014-10-20 19:34:27 +02:00
parent 683efb5a43
commit 38b2bcc690

View File

@@ -1171,15 +1171,16 @@ void UpdateDatabase::run()
bool JumpToPlayingSong::canBeRun() const bool JumpToPlayingSong::canBeRun() const
{ {
return ((myScreen == myPlaylist && !myPlaylist->isFiltered()) return (myScreen == myPlaylist && !myPlaylist->isFiltered())
|| myScreen == myBrowser || myScreen == myBrowser
|| myScreen == myLibrary) || myScreen == myLibrary;
&& !myPlaylist->nowPlayingSong().empty();
} }
void JumpToPlayingSong::run() void JumpToPlayingSong::run()
{ {
auto s = myPlaylist->nowPlayingSong(); auto s = myPlaylist->nowPlayingSong();
if (s.empty())
return;
if (myScreen == myPlaylist) if (myScreen == myPlaylist)
{ {
myPlaylist->main().highlight(s.getPosition()); myPlaylist->main().highlight(s.getPosition());