diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 6203b159929..2258141385f 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4682,6 +4682,8 @@ bool TextEdit::has_keyword_color(String p_keyword) const { } Color TextEdit::get_keyword_color(String p_keyword) const { + + ERR_FAIL_COND_V(!keywords.has(p_keyword), Color()) return keywords[p_keyword]; }