From 3e97ed39bdf1e211648e9b0f0b37a07cc746c0b4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 21 May 2015 13:44:57 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/docx/writer/styles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/docx/writer/styles.py b/src/calibre/ebooks/docx/writer/styles.py index 804dfe49e7..f1647ad4e4 100644 --- a/src/calibre/ebooks/docx/writer/styles.py +++ b/src/calibre/ebooks/docx/writer/styles.py @@ -695,7 +695,7 @@ class StylesManager(object): ds_counts = Counter() for block in all_blocks: for run in block.runs: - if run.parent_style is not run.style: + if run.parent_style is not run.style and run.parent_style and run.style: ds = DescendantTextStyle(run.parent_style, run.style) if ds.properties: run.descendant_style = descendant_style_map.get(ds)