From b44ff4b8e8f679ecc946947f4157b8b295a21c14 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 6 Oct 2024 19:07:17 +0200 Subject: [PATCH] Avoid a potential hard assertion in debug mode --- src/lay/lay/layMacroEditorPage.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lay/lay/layMacroEditorPage.cc b/src/lay/lay/layMacroEditorPage.cc index b0818e6f4..5b601b6e9 100644 --- a/src/lay/lay/layMacroEditorPage.cc +++ b/src/lay/lay/layMacroEditorPage.cc @@ -753,7 +753,7 @@ void MacroEditorPage::fill_completer_list () QString ssel = c.selectedText (); QString s = ssel.mid (0, pos - pos0); - if (! s[0].isLetter () && s[0].toLatin1 () != '_') { + if (s.length () == 0 || (! s[0].isLetter () && s[0].toLatin1 () != '_')) { return; // not a word }