From 417609c1f08b236e6f5478a848a8e1c38209206d Mon Sep 17 00:00:00 2001 From: pictuga Date: Sat, 16 Nov 2013 16:00:07 +0100 Subject: [PATCH] Fix crash on empty html pages Was due to "chardet" returning "None", which then crashed "str.replace" --- morss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/morss.py b/morss.py index c4ece16..bf7107b 100644 --- a/morss.py +++ b/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) """