From 822af935e3878013bb2cb3b90f0342e52a4d1a52 Mon Sep 17 00:00:00 2001 From: jagt Date: Tue, 24 Oct 2017 13:07:21 +0800 Subject: [PATCH] fix editor crash when missing variable in pattern match dispatch --- modules/gdscript/gd_parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 36aaa1f807f..94385dc0d07 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -1906,7 +1906,8 @@ GDParser::PatternNode *GDParser::_parse_pattern(bool p_static) { // all the constants like strings and numbers default: { Node *value = _parse_and_reduce_expression(pattern, p_static); - if (error_set) { + if (!value) { + _set_error("Expect constant expression or variables in a pattern"); return NULL; }