TextEdit - fix valid bounds in 'set_line'. Fixes #41967
(cherry picked from commit 99c8a07919
)
This commit is contained in:
parent
3e4816efbd
commit
ba00ced445
1 changed files with 1 additions and 1 deletions
|
@ -6745,7 +6745,7 @@ void TextEdit::set_tooltip_request_func(Object *p_obj, const StringName &p_funct
|
|||
}
|
||||
|
||||
void TextEdit::set_line(int line, String new_text) {
|
||||
if (line < 0 || line > text.size())
|
||||
if (line < 0 || line >= text.size())
|
||||
return;
|
||||
_remove_text(line, 0, line, text[line].length());
|
||||
_insert_text(line, 0, new_text);
|
||||
|
|
Loading…
Add table
Reference in a new issue