Переглянути джерело

Don't try to connect "text_entered" signal to nodes other than LineEdit

Rafał Mikrut 5 роки тому
батько
коміт
0a1d3e4437
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      scene/gui/dialogs.cpp

+ 3 - 1
scene/gui/dialogs.cpp

@@ -443,7 +443,9 @@ bool AcceptDialog::has_autowrap() {
 void AcceptDialog::register_text_enter(Node *p_line_edit) {
 
 	ERR_FAIL_NULL(p_line_edit);
-	p_line_edit->connect("text_entered", this, "_builtin_text_entered");
+	LineEdit *line_edit = Object::cast_to<LineEdit>(p_line_edit);
+	if (line_edit)
+		line_edit->connect("text_entered", this, "_builtin_text_entered");
 }
 
 void AcceptDialog::_update_child_rects() {