8000 Merge pull request #27 from sunlightlabs/master · littletao08/python-readability@c923995 · GitHub
[go: up one dir, main page]

Skip to content

Commit c923995

Browse files
committed
Merge pull request buriy#27 from sunlightlabs/master
Simple guard for empty title elements. Thanks, dvogel!
2 parents 9cd5fb6 + fdba8d9 commit c923995

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

readability/htmls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def add_match(collection, text, orig):
5757

5858
def shorten_title(doc):
5959
title = doc.find('.//title')
60-
if title is None or len(title.text) == 0:
60+
if title is None or title.text is None or len(title.text) == 0:
6161
return ''
6262

6363
title = orig = norm_title(title.text)

0 commit comments

Comments
 (0)
0