From 8a605d227d297ebfac15147912deea6d0d92b6c6 Mon Sep 17 00:00:00 2001 From: kobewi Date: Fri, 13 Aug 2021 00:19:55 +0200 Subject: Prevent crash when awaiting in a getter/setter --- modules/gdscript/gdscript_parser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index a21167ad95..5b67ab3f14 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2415,7 +2415,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_await(ExpressionNode *p_pr AwaitNode *await = alloc_node(); 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; } -- cgit v1.2.3