Browse Source

Merge pull request #62578 from MinusKube/editor-print-crash

Fix GDScript parser sometimes crashing when issuing warning for unreachable pattern
George Marques 3 năm trước cách đây
mục cha
commit
bf1ef0498e
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      modules/gdscript/gdscript_parser.cpp

+ 1 - 1
modules/gdscript/gdscript_parser.cpp

@@ -1862,7 +1862,7 @@ GDScriptParser::MatchNode *GDScriptParser::parse_match() {
 		}
 
 #ifdef DEBUG_ENABLED
-		if (have_wildcard_without_continue) {
+		if (have_wildcard_without_continue && !branch->patterns.is_empty()) {
 			push_warning(branch->patterns[0], GDScriptWarning::UNREACHABLE_PATTERN);
 		}