Fix GDScript parser sometimes crashing when issuing warning for unreachable pattern

This commit is contained in:
MinusKube 2022-07-01 02:05:00 +02:00
parent afdae67cc3
commit 92367bad4e

View file

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