From 576892863c6ec7bfffda05a5dfb929e5561e7ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Thu, 16 Jan 2025 10:40:13 +0200 Subject: [PATCH] Fix GDScript editor crash on invalid `tween_property` arguments. --- modules/gdscript/gdscript_editor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 4b4eb1af148..743fe5711e9 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -2860,7 +2860,15 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c if (p_argidx == 1 && p_context.node && p_context.node->type == GDScriptParser::Node::CALL && ClassDB::is_parent_class(class_name, SNAME("Tween")) && p_method == SNAME("tween_property")) { // Get tweened objects properties. + if (static_cast(p_context.node)->arguments.is_empty()) { + base_type.kind = GDScriptParser::DataType::UNRESOLVED; + break; + } GDScriptParser::ExpressionNode *tweened_object = static_cast(p_context.node)->arguments[0]; + if (!tweened_object) { + base_type.kind = GDScriptParser::DataType::UNRESOLVED; + break; + } StringName native_type = tweened_object->datatype.native_type; switch (tweened_object->datatype.kind) { case GDScriptParser::DataType::SCRIPT: {