Merge pull request #53856 from vnen/gdscript-setter-crash
This commit is contained in:
commit
08d1ce718d
|
@ -967,6 +967,7 @@ void GDScriptParser::parse_property_setter(VariableNode *p_variable) {
|
|||
ParameterNode *parameter = alloc_node<ParameterNode>();
|
||||
parameter->identifier = p_variable->setter_parameter;
|
||||
|
||||
if (parameter->identifier != nullptr) {
|
||||
function->parameters_indices[parameter->identifier->name] = 0;
|
||||
function->parameters.push_back(parameter);
|
||||
|
||||
|
@ -974,8 +975,9 @@ void GDScriptParser::parse_property_setter(VariableNode *p_variable) {
|
|||
body->add_local(parameter, function);
|
||||
|
||||
function->body = parse_suite("setter declaration", body);
|
||||
|
||||
p_variable->setter = function;
|
||||
}
|
||||
|
||||
current_function = previous_function;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue