Explorar o código

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

Dominik 'dreamsComeTrue' Jasiński %!s(int64=4) %!d(string=hai) anos
pai
achega
99c8a07919
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      scene/gui/text_edit.cpp

+ 1 - 1
scene/gui/text_edit.cpp

@@ -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) {
-	if (line < 0 || line > text.size()) {
+	if (line < 0 || line >= text.size()) {
 		return;
 	}
 	_remove_text(line, 0, line, text[line].length());