From bbf5c92ba2347014c677420ba7a391962d15316d Mon Sep 17 00:00:00 2001 From: pictuga Date: Sat, 8 Jun 2013 17:30:11 +0200 Subject: [PATCH] Fix lenHTML() with empty string --- morss.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/morss.py b/morss.py index befdff0..db44b56 100644 --- a/morss.py +++ b/morss.py @@ -70,7 +70,10 @@ def cleanXML(xml): return xml.translate(table, table[:32]).lstrip() def lenHTML(txt): - return len(lxml.html.fromstring(txt).text_content()) + if len(txt): + return len(lxml.html.fromstring(txt).text_content()) + else: + return 0 def parseOptions(available): options = None