diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 40be5cb3242..7ddb9b93b4d 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -967,15 +967,17 @@ void GDScriptParser::parse_property_setter(VariableNode *p_variable) { ParameterNode *parameter = alloc_node(); parameter->identifier = p_variable->setter_parameter; - function->parameters_indices[parameter->identifier->name] = 0; - function->parameters.push_back(parameter); + if (parameter->identifier != nullptr) { + function->parameters_indices[parameter->identifier->name] = 0; + function->parameters.push_back(parameter); - SuiteNode *body = alloc_node(); - body->add_local(parameter, function); + SuiteNode *body = alloc_node(); + body->add_local(parameter, function); - function->body = parse_suite("setter declaration", body); + function->body = parse_suite("setter declaration", body); + p_variable->setter = function; + } - p_variable->setter = function; current_function = previous_function; break; }