From 8f18290228d538f2bf6d3a03c351e475ae3b09b9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 29 Aug 2014 18:23:41 +0530 Subject: [PATCH] Check Book: Fix an error caused by empty style tags when auto-renaming mismatched font names. Fixes #1363028 [renaming incorrectly named fonts fails](https://bugs.launchpad.net/calibre/+bug/1363028) --- src/calibre/ebooks/oeb/polish/check/fonts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/check/fonts.py b/src/calibre/ebooks/oeb/polish/check/fonts.py index 1ca44bd8e8..b7afc6a352 100644 --- a/src/calibre/ebooks/oeb/polish/check/fonts.py +++ b/src/calibre/ebooks/oeb/polish/check/fonts.py @@ -74,7 +74,7 @@ class FontAliasing(BaseError): changed = True elif mt in OEB_DOCS: for style in container.parsed(name).xpath('//*[local-name()="style"]'): - if style.get('type', 'text/css') == 'text/css': + if style.get('type', 'text/css') == 'text/css' and style.text: sheet = container.parse_css(style.text) if fix_sheet(sheet, self.css_name, self.font_name): style.text = force_unicode(sheet.cssText, 'utf-8')