mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-24 16:31:22 +01:00
Fix a crash when requesting an invalid playlist index over MPRIS. Fixes issue #1041
This commit is contained in:
parent
9a7087d05f
commit
67452baa4d
@ -273,7 +273,11 @@ int Mpris1TrackList::GetLength() const {
|
||||
}
|
||||
|
||||
QVariantMap Mpris1TrackList::GetMetadata(int pos) const {
|
||||
return Mpris1::GetMetadata(player_->GetItemAt(pos)->Metadata());
|
||||
PlaylistItemPtr item = player_->GetItemAt(pos);
|
||||
if (!item)
|
||||
return QVariantMap();
|
||||
|
||||
return Mpris1::GetMetadata(item->Metadata());
|
||||
}
|
||||
|
||||
void Mpris1TrackList::SetLoop(bool enable) {
|
||||
|
Loading…
Reference in New Issue
Block a user