Selaa lähdekoodia

TextEdit - fix valid bounds in 'set_line'. Fixes #41967

(cherry picked from commit 99c8a0791916d6fe11763f54eeaef0c850112c0f)
Dominik 'dreamsComeTrue' Jasiński 4 vuotta sitten
vanhempi
commit
ba00ced445
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      scene/gui/text_edit.cpp

+ 1 - 1
scene/gui/text_edit.cpp

@@ -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);