diff options
author | Thomas Herzog <thomas.herzog@mail.com> | 2017-10-24 11:30:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-24 11:30:51 +0200 |
commit | 43967121378c796f3780c64af4f2da07cf85c54c (patch) | |
tree | 6ba2a90461b030eb0180b9923ccd910403d55cbe /modules/gdscript | |
parent | 4af59c5b3ffddab769c47ce2d0a2988b979fa54d (diff) | |
parent | 822af935e3878013bb2cb3b90f0342e52a4d1a52 (diff) |
Merge pull request #12370 from jagt/fix-match-crash-in-editor
Fix editor crash when missing variable in pattern match dispatch.
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gd_parser.cpp | 3 |
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; } |