diff options
author | George Marques <george@gmarqu.es> | 2021-09-10 10:36:25 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-10 10:36:25 -0300 |
commit | 11e457e594844f6defc5c105ecb78f6b6c49cfff (patch) | |
tree | a59cf8915c88e5540f118728d9c5e01dfbb90ff9 /modules/gdscript | |
parent | 1234c2bdd9fcac46e66af8532920d9b40776cf37 (diff) | |
parent | 8a605d227d297ebfac15147912deea6d0d92b6c6 (diff) |
Merge pull request #51593 from KoBeWi/if
Prevent crash when awaiting in a getter/setter
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 4 |
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; } |