Skip to content

Commit

Permalink
Merge pull request godotengine#101632 from bruvzg/gds_tween_property_…
Browse files Browse the repository at this point in the history
…crash

Fix GDScript editor crash on invalid `tween_property` arguments.
  • Loading branch information
Repiteo committed Jan 17, 2025
2 parents 041cb20 + 5768928 commit 9630d4e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/gdscript/gdscript_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<GDScriptParser::CallNode *>(p_context.node)->arguments.is_empty()) {
base_type.kind = GDScriptParser::DataType::UNRESOLVED;
break;
}
GDScriptParser::ExpressionNode *tweened_object = static_cast<GDScriptParser::CallNode *>(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: {
Expand Down

0 comments on commit 9630d4e

Please sign in to comment.