فهرست منبع

Merge pull request #81018 from jsjtxietian/return-use-friendly-info-in-scriptStackVariable-serialize

Fix `_get_debug_tooltip` crash if tooltip string is too large
Yuri Sizov 1 سال پیش
والد
کامیت
14cc639bc3
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      editor/plugins/script_editor_plugin.cpp

+ 4 - 0
editor/plugins/script_editor_plugin.cpp

@@ -433,7 +433,11 @@ ScriptEditor *ScriptEditor::script_editor = nullptr;
 
 String ScriptEditor::_get_debug_tooltip(const String &p_text, Node *_se) {
 	String val = EditorDebuggerNode::get_singleton()->get_var_value(p_text);
+	const int display_limit = 300;
 	if (!val.is_empty()) {
+		if (val.size() > display_limit) {
+			val = val.left(display_limit) + " [...] truncated!";
+		}
 		return p_text + ": " + val;
 	} else {
 		return String();