DOCX Input: Handle DOCX files with missing referenced styles

Fixes #1228669 [.docx conversion fails w/ attribute error](https://bugs.launchpad.net/calibre/+bug/1228669)
This commit is contained in:
Kovid Goyal 2013-09-22 08:55:46 +05:30
parent 0ba14158c2
commit 87a8f703be

View File

@ -301,7 +301,7 @@ class Styles(object):
if ts is not None: if ts is not None:
parent_styles.append(ts) parent_styles.append(ts)
if direct_formatting.linked_style is not None: 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: if ls is not None:
parent_styles.append(ls) parent_styles.append(ls)
elif default_char is not None and default_char.character_style is not None: elif default_char is not None and default_char.character_style is not None: