Fix crash on empty html pages
Was due to "chardet" returning "None", which then crashed "str.replace"master
parent
6975772ef9
commit
417609c1f0
2
morss.py
2
morss.py
|
@ -278,7 +278,7 @@ def decodeHTML(data, con=None):
|
|||
enc = chardet.detect(data)['encoding']
|
||||
|
||||
log(enc)
|
||||
return data.decode(enc, 'replace')
|
||||
return data.decode(enc, 'replace') if enc else data
|
||||
|
||||
def Fix(item, feedurl='/'):
|
||||
""" Improves feed items (absolute links, resolve feedburner links, etc) """
|
||||
|
|
Loading…
Reference in New Issue