From d8a3982c5e2b9ac0647ce3622dfdefe667450e24 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sat, 4 May 2024 22:01:06 +0100 Subject: [PATCH] Fix error when changing the style of misspelt words In the note editor, changing the style of text failing the spell check caused an error. The style tag used by the spell checker to indicate spelling errors has no tag name. Fixes #13282. --- gramps/gui/widgets/styledtextbuffer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gramps/gui/widgets/styledtextbuffer.py b/gramps/gui/widgets/styledtextbuffer.py index 5cbad58e614..5e917e19528 100644 --- a/gramps/gui/widgets/styledtextbuffer.py +++ b/gramps/gui/widgets/styledtextbuffer.py @@ -492,7 +492,7 @@ def _remove_style_from_selection(self, style): start, end = self._get_selection() tags = self._get_tag_from_range(start.get_offset(), end.get_offset()) for tag_name, tag_data in tags.items(): - if tag_name.startswith(str(style)): + if tag_name is not None and tag_name.startswith(str(style)): for start, end in tag_data: self.remove_tag_by_name( tag_name,