summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMinusKube <minuskube@gmail.com>2022-07-01 02:05:00 +0200
committerMinusKube <minuskube@gmail.com>2022-07-01 02:05:00 +0200
commit92367bad4e6ca204eeea2ca41277a3e4df4b5567 (patch)
tree71cf3a6936d4e680010fb915bb26b08406e2053d /modules
parentafdae67cc381bb340da2e864279da6b836804b7f (diff)
Fix GDScript parser sometimes crashing when issuing warning for unreachable pattern
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gdscript_parser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index ca430b0f72..b8670f00d0 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -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);
}