Skip to content

Commit 9630d4e

Browse files
committed
Merge pull request #101632 from bruvzg/gds_tween_property_crash
Fix GDScript editor crash on invalid `tween_property` arguments.
2 parents 041cb20 + 5768928 commit 9630d4e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

modules/gdscript/gdscript_editor.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -2860,7 +2860,15 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c
28602860

28612861
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")) {
28622862
// Get tweened objects properties.
2863+
if (static_cast<GDScriptParser::CallNode *>(p_context.node)->arguments.is_empty()) {
2864+
base_type.kind = GDScriptParser::DataType::UNRESOLVED;
2865+
break;
2866+
}
28632867
GDScriptParser::ExpressionNode *tweened_object = static_cast<GDScriptParser::CallNode *>(p_context.node)->arguments[0];
2868+
if (!tweened_object) {
2869+
base_type.kind = GDScriptParser::DataType::UNRESOLVED;
2870+
break;
2871+
}
28642872
StringName native_type = tweened_object->datatype.native_type;
28652873
switch (tweened_object->datatype.kind) {
28662874
case GDScriptParser::DataType::SCRIPT: {

0 commit comments

Comments
 (0)