From 5f69c649716a063182ab97da4c3c2364525cc536 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Wed, 5 May 2010 23:15:22 +0000 Subject: [PATCH] Ignore (and remove) style tags this version of gramps doesn't know about, rather than crash svn: r15331 --- src/gui/widgets/styledtextbuffer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/styledtextbuffer.py b/src/gui/widgets/styledtextbuffer.py index 860d82862..e34e3a0ff 100644 --- a/src/gui/widgets/styledtextbuffer.py +++ b/src/gui/widgets/styledtextbuffer.py @@ -474,7 +474,9 @@ class StyledTextBuffer(gtk.TextBuffer): If TextTag does not exist yet, it is created. """ - if StyledTextTagType.STYLE_TYPE[style] == bool: + if style not in StyledTextTagType.STYLE_TYPE: + return None + elif StyledTextTagType.STYLE_TYPE[style] == bool: tag_name = str(style) elif StyledTextTagType.STYLE_TYPE[style] == str: tag_name = "%d %s" % (style, value)