GDScript: Fix crash on 'await' completion

This commit is contained in:
George Marques 2020-07-27 09:50:36 -03:00
parent 0500fa1b73
commit 04f46aea8d
No known key found for this signature in database
GPG Key ID: 046BD46A3201E43D
1 changed files with 6 additions and 0 deletions

View File

@ -1430,6 +1430,12 @@ void GDScriptAnalyzer::reduce_assignment(GDScriptParser::AssignmentNode *p_assig
}
void GDScriptAnalyzer::reduce_await(GDScriptParser::AwaitNode *p_await) {
if (p_await->to_await == nullptr) {
GDScriptParser::DataType await_type;
await_type.kind = GDScriptParser::DataType::VARIANT;
p_await->set_datatype(await_type);
return;
}
if (p_await->to_await->type == GDScriptParser::Node::CALL) {
reduce_call(static_cast<GDScriptParser::CallNode *>(p_await->to_await), true);
} else {