8000 Added check on title.text to avoid a TypeError on None. · Harry0201/python-readability@fdba8d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit fdba8d9

Browse files
author
Drew Vogel
committed
Added check on title.text to avoid a TypeError on None.
1 parent 9cd5fb6 commit fdba8d9

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