summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2022-07-13 08:44:40 -0300
committerGitHub <noreply@github.com>2022-07-13 08:44:40 -0300
commitbf1ef0498e0a2b0738f572003ce1e151d6e9b9cf (patch)
tree85149041012319b1381f1783fb97e9c5b8200668
parent8b059d47f669eba45c0ee4331be16c0faddafc0a (diff)
parent92367bad4e6ca204eeea2ca41277a3e4df4b5567 (diff)
Merge pull request #62578 from MinusKube/editor-print-crash
Fix GDScript parser sometimes crashing when issuing warning for unreachable pattern
-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 233da87aee..632d5ec3ff 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/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);
}