瀏覽代碼

fix editor crash when missing variable in pattern match dispatch

jagt 8 年之前
父節點
當前提交
822af935e3
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      modules/gdscript/gd_parser.cpp

+ 2 - 1
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;
 			}