Added check on title.text to avoid a TypeError on None.

pull/27/head
Drew Vogel 12 years ago
parent 9cd5fb6226
commit fdba8d9e11

@ -57,7 +57,7 @@ def add_match(collection, text, orig):
def shorten_title(doc):
title = doc.find('.//title')
if title is None or len(title.text) == 0:
if title is None or title.text is None or len(title.text) == 0:
return ''
title = orig = norm_title(title.text)

Loading…
Cancel
Save