summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorjagt <jagt@live.com>2017-10-24 13:07:21 +0800
committerjagt <jagt@live.com>2017-10-24 13:07:21 +0800
commit822af935e3878013bb2cb3b90f0342e52a4d1a52 (patch)
tree79d718986768a0b19c56dcc8f1f3277ae5c0a529 /modules/gdscript
parenta897f7f6067ad8eece36702974b2b8ae94bff4be (diff)
fix editor crash when missing variable in pattern match dispatch
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gd_parser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index 36aaa1f807..94385dc0d0 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;
}