status: always check if current song is not empty

This commit is contained in:
Andrzej Rybczak
2015-06-15 16:41:58 +02:00
parent 89d593799c
commit d5b4f1f8af
2 changed files with 39 additions and 39 deletions

View File

@@ -369,7 +369,11 @@ Song Connection::GetCurrentSong()
mpd_song *s = mpd_recv_song(m_connection.get());
mpd_response_finish(m_connection.get());
checkErrors();
return Song(s);
// currentsong doesn't return error if there is no playing song.
if (s == nullptr)
return Song();
else
return Song(s);
}
Song Connection::GetSong(const std::string &path)