summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorSaracenOne <SaracenOne@gmail.com>2021-11-29 09:53:11 +0000
committerSaracenOne <SaracenOne@gmail.com>2021-11-29 11:29:15 +0000
commit3eec759e8715afe41002f893c528df78ffbe6220 (patch)
treeb5c541a1f7c814d532a3a8415a0524315df9652d /modules/gdscript
parent69a194f051c5f02243092e305633b9ffbd03b05f (diff)
Check for nullptr expression in parse_precedence function
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gdscript_parser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 41b2d2191c..c50f9c9007 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -2107,7 +2107,7 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_precedence(Precedence p_pr
ExpressionNode *previous_operand = (this->*prefix_rule)(nullptr, p_can_assign);
while (p_precedence <= get_rule(current.type)->precedence) {
- if (p_stop_on_assign && current.type == GDScriptTokenizer::Token::EQUAL) {
+ if (previous_operand == nullptr || (p_stop_on_assign && current.type == GDScriptTokenizer::Token::EQUAL)) {
return previous_operand;
}
// Also switch multiline mode on here for infix operators.