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

Fix GDScript parser sometimes crashing when issuing warning for unreachable pattern
This commit is contained in:
George Marques 2022-07-13 08:44:40 -03:00 committed by GitHub
commit bf1ef0498e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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