summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2021-09-10 10:36:25 -0300
committerGitHub <noreply@github.com>2021-09-10 10:36:25 -0300
commit11e457e594844f6defc5c105ecb78f6b6c49cfff (patch)
treea59cf8915c88e5540f118728d9c5e01dfbb90ff9 /modules
parent1234c2bdd9fcac46e66af8532920d9b40776cf37 (diff)
parent8a605d227d297ebfac15147912deea6d0d92b6c6 (diff)
Merge pull request #51593 from KoBeWi/if
Prevent crash when awaiting in a getter/setter
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gdscript_parser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 4f275ca240..d2b10f41e7 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -2385,7 +2385,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_await(ExpressionNode *p_pr
}
await->to_await = element;
- current_function->is_coroutine = true;
+ if (current_function) { // Might be null in a getter or setter.
+ current_function->is_coroutine = true;
+ }
return await;
}