Do not try to set item['images'] if it is not defined in the Item.

This commit is contained in:
Libor Nenadl 2012-05-05 14:53:02 +02:00
parent 43028876b5
commit 2b93b0a93c
1 changed files with 2 additions and 1 deletions

View File

@ -309,5 +309,6 @@ class ImagesPipeline(MediaPipeline):
return [Request(x) for x in item.get('image_urls', [])]
def item_completed(self, results, item, info):
item['images'] = [x for ok, x in results if ok]
if 'images' in item.fields:
item['images'] = [x for ok, x in results if ok]
return item