From c4e7d0ec2578d87368dd1a0210f6edbc6aa330a9 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 31 Jan 2016 09:17:01 -0500 Subject: [PATCH] StyledText: don't crash if styles are corrupt --- gramps/gui/widgets/styledtextbuffer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gramps/gui/widgets/styledtextbuffer.py b/gramps/gui/widgets/styledtextbuffer.py index 342f86f9e..84530a2fc 100644 --- a/gramps/gui/widgets/styledtextbuffer.py +++ b/gramps/gui/widgets/styledtextbuffer.py @@ -567,7 +567,10 @@ class StyledTextBuffer(UndoableBuffer): foreground=self.linkcolor, underline=UNDERLINE_SINGLE) else: - g_tag = self._find_tag_by_name(int(s_tag.name), s_tag.value) + try: + g_tag = self._find_tag_by_name(int(s_tag.name), s_tag.value) + except: + g_tag = None if g_tag is not None: for (start, end) in s_tag.ranges: start_iter = self.get_iter_at_offset(start)