Avoid a potential hard assertion in debug mode

This commit is contained in:
Matthias Koefferlein 2024-10-06 19:07:17 +02:00
parent 4be134e293
commit b44ff4b8e8
1 changed files with 1 additions and 1 deletions

View File

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