StyledText: don't crash if styles are corrupt

This commit is contained in:
Doug Blank 2016-01-31 09:17:01 -05:00
parent 403c87b887
commit c4e7d0ec25

View File

@ -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)