Merge pull request #12370 from jagt/fix-match-crash-in-editor

Fix editor crash when missing variable in pattern match dispatch.
This commit is contained in:
Thomas Herzog 2017-10-24 11:30:51 +02:00 committed by GitHub
commit 4396712137

View file

@ -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;
}