Merge pull request #42874 from dreamsComeTrue/text-edit-bounds-fix

TextEdit - fix valid bounds in 'set_line'.
This commit is contained in:
Rémi Verschelde 2020-10-19 22:37:41 +02:00 committed by GitHub
commit ff48a6a3bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -6406,7 +6406,7 @@ void TextEdit::set_tooltip_request_func(Object *p_obj, const StringName &p_funct
} }
void TextEdit::set_line(int line, String new_text) { void TextEdit::set_line(int line, String new_text) {
if (line < 0 || line > text.size()) { if (line < 0 || line >= text.size()) {
return; return;
} }
_remove_text(line, 0, line, text[line].length()); _remove_text(line, 0, line, text[line].length());