Edit Book: Fix an error when running the Check Book tool on files with empty <style> tags. Fixes #1320459 [Private bug](https://bugs.launchpad.net/calibre/+bug/1320459)

This commit is contained in:
Kovid Goyal 2014-05-17 21:50:56 +05:30
parent 6f6812ccd7
commit 15698f60a7

View File

@ -111,7 +111,7 @@ def check_fonts(container):
sheets.append((name, container.parsed(name), None)) sheets.append((name, container.parsed(name), None))
elif mt in OEB_DOCS: elif mt in OEB_DOCS:
for style in container.parsed(name).xpath('//*[local-name()="style"]'): 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:
sheets.append((name, container.parse_css(style.text), style.sourceline)) sheets.append((name, container.parse_css(style.text), style.sourceline))
for name, sheet, line_offset in sheets: for name, sheet, line_offset in sheets: