From 52a89edb1859cdbbcf210fe7bc42fd4a1e29cb68 Mon Sep 17 00:00:00 2001 From: scotto Date: Fri, 16 Dec 2011 00:08:35 -0500 Subject: [PATCH] Check to be sure task.items[0] isn't NoneType before proceeding with albumartist and mb_albumartistid tests in order to avoid an error. --- beets/importer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beets/importer.py b/beets/importer.py index a902ea38a2..3272954efe 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -19,6 +19,7 @@ import os import logging import pickle +import types from collections import defaultdict from beets import autotag @@ -170,9 +171,9 @@ def _infer_album_fields(task): elif task.choice_flag == action.APPLY: # Applying autotagged metadata. Just get AA from the first # item. - if not task.items[0].albumartist: + if not isinstance(task.items[0],types.NoneType) and not task.items[0].albumartist: changes['albumartist'] = task.items[0].artist - if not task.items[0].mb_albumartistid: + if not isinstance(task.items[0],types.NoneType) and not task.items[0].mb_albumartistid: changes['mb_albumartistid'] = task.items[0].mb_artistid else: