1
0
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:
David Sansome 2010-12-11 10:58:15 +00:00
parent 9a7087d05f
commit 67452baa4d

View File

@ -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) {