1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

GDScript: Fix crash when parsing properties

This commit is contained in:
George Marques
2020-08-26 16:08:19 -03:00
parent b2b45987d0
commit 5033d5c71c

View File

@@ -1355,7 +1355,7 @@ GDScriptParser::Node *GDScriptParser::parse_statement() {
advance();
ReturnNode *n_return = alloc_node<ReturnNode>();
if (!is_statement_end()) {
if (current_function->identifier->name == GDScriptLanguage::get_singleton()->strings._init) {
if (current_function && current_function->identifier->name == GDScriptLanguage::get_singleton()->strings._init) {
push_error(R"(Constructor cannot return a value.)");
}
n_return->return_value = parse_expression(false);