diff options
author | George Marques <george@gmarqu.es> | 2020-08-26 16:08:19 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2020-08-26 16:08:19 -0300 |
commit | 5033d5c71c1140262953c993568d48ed762648c5 (patch) | |
tree | 91d6c610df0935b9f6fd66940f0176b611605858 /modules | |
parent | b2b45987d007a22f2a7c07ce06fe55338217c86c (diff) |
GDScript: Fix crash when parsing properties
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index f313602bd7..03da5e926b 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -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); |