From 87a8f703beeab44a2084eda7440d56eef78d00eb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 22 Sep 2013 08:55:46 +0530 Subject: [PATCH] DOCX Input: Handle DOCX files with missing referenced styles Fixes #1228669 [.docx conversion fails w/ attribute error](https://bugs.launchpad.net/calibre/+bug/1228669) --- src/calibre/ebooks/docx/styles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/docx/styles.py b/src/calibre/ebooks/docx/styles.py index 142cb9e89d..03bbc1d7d3 100644 --- a/src/calibre/ebooks/docx/styles.py +++ b/src/calibre/ebooks/docx/styles.py @@ -301,7 +301,7 @@ class Styles(object): if ts is not None: parent_styles.append(ts) if direct_formatting.linked_style is not None: - ls = self.get(direct_formatting.linked_style).character_style + ls = getattr(self.get(direct_formatting.linked_style), 'character_style', None) if ls is not None: parent_styles.append(ls) elif default_char is not None and default_char.character_style is not None: