mpd: Check if track.album exists before using it

This commit is contained in:
Stein Magnus Jodal 2013-11-02 22:00:35 +01:00
parent 86f18935fe
commit 0df84b85d0

View File

@ -242,9 +242,10 @@ def _list_albumartist(context, query):
albumartists = set()
results = context.core.library.find_exact(**query).get()
for track in _get_tracks(results):
for artist in track.album.artists:
if artist.name:
albumartists.add(('AlbumArtist', artist.name))
if track.album:
for artist in track.album.artists:
if artist.name:
albumartists.add(('AlbumArtist', artist.name))
return albumartists