From 781006e25ad752deb4e151400b21208b68813779 Mon Sep 17 00:00:00 2001 From: Cameron Reikes Date: Thu, 8 Aug 2019 21:52:27 -0700 Subject: [PATCH] Expression before 'is' may be null (cherry picked from commit 2339e85b783b7ccbb4e7a233b9c54c7e0546eb13) --- modules/gdscript/gdscript_parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index fa174a6308..fbca71f298 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -910,6 +910,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(); op->op = OperatorNode::OP_IS_BUILTIN; op->arguments.push_back(expr);