From 052351795a0ae3d86dac86a6f0a8fa0a5762002b Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Thu, 19 Nov 2015 13:02:39 -0600 Subject: [PATCH] sanitize_html shouldn't error when handed an empty string. --- src/calibre/library/comments.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/library/comments.py b/src/calibre/library/comments.py index 7edfef2d75..e9a4a50410 100644 --- a/src/calibre/library/comments.py +++ b/src/calibre/library/comments.py @@ -134,6 +134,8 @@ def merge_comments(one, two): return comments_to_html(one) + '\n\n' + comments_to_html(two) def sanitize_html(html): + if not html: + return u'' if isinstance(html, bytes): html = html.decode('utf-8', 'replace') import html5lib