Fix segfault when GetMetadata() is called when no song is playing.
This commit is contained in:
parent
b6e3c52f44
commit
c00493223d
|
@ -380,7 +380,11 @@ QVariantMap Player::GetMetadata(const PlaylistItem& item) const {
|
|||
}
|
||||
|
||||
QVariantMap Player::GetMetadata() const {
|
||||
return GetMetadata(*(playlist_->current_item()));
|
||||
PlaylistItem* item = playlist_->current_item();
|
||||
if (item) {
|
||||
return GetMetadata(*item);
|
||||
}
|
||||
return QVariantMap();
|
||||
}
|
||||
|
||||
QVariantMap Player::GetMetadata(int track) const {
|
||||
|
|
Loading…
Reference in New Issue