summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-08-09 11:19:00 +0200
committerGitHub <noreply@github.com>2019-08-09 11:19:00 +0200
commit51cd47e2aa6adfeab99cade9433fd2ee49f4ba4b (patch)
treebb0cfbdc2087bae9f1a5c1c7b6f59b4ef3bdf573 /modules
parent432ef8e486b4a3ad17997e2552696387f2d41c1d (diff)
parent2339e85b783b7ccbb4e7a233b9c54c7e0546eb13 (diff)
Merge pull request #31226 from creikey/fix-is-crash
Expression before 'is' may be null
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gdscript_parser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 357e9c9615..d82990bd6e 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -898,6 +898,10 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
} else if (tokenizer->get_token() == GDScriptTokenizer::TK_PR_IS && tokenizer->get_token(1) == GDScriptTokenizer::TK_BUILT_IN_TYPE) {
// 'is' operator with built-in type
+ if (!expr) {
+ _set_error("Expected identifier before 'is' operator");
+ return NULL;
+ }
OperatorNode *op = alloc_node<OperatorNode>();
op->op = OperatorNode::OP_IS_BUILTIN;
op->arguments.push_back(expr);