Prevent crash when awaiting in a getter/setter
This commit is contained in:
parent
a98589a449
commit
8a605d227d
1 changed files with 3 additions and 1 deletions
|
|
@ -2415,7 +2415,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_await(ExpressionNode *p_pr
|
||||||
AwaitNode *await = alloc_node<AwaitNode>();
|
AwaitNode *await = alloc_node<AwaitNode>();
|
||||||
await->to_await = parse_precedence(PREC_AWAIT, false);
|
await->to_await = parse_precedence(PREC_AWAIT, false);
|
||||||
|
|
||||||
current_function->is_coroutine = true;
|
if (current_function) { // Might be null in a getter or setter.
|
||||||
|
current_function->is_coroutine = true;
|
||||||
|
}
|
||||||
|
|
||||||
return await;
|
return await;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue