From a3d9b7d9162259c26d01ce659b49119751a5195a Mon Sep 17 00:00:00 2001 From: Vasiliy Makarov Date: Tue, 5 Mar 2019 18:23:25 +0300 Subject: [PATCH] Check cursor line and column Added a trivial check if cursor.line and cursor.column are valid. Fix #26245 --- scene/gui/text_edit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index f38bc62a3c8..2bf23648734 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -666,7 +666,7 @@ void TextEdit::_notification(int p_what) { bool brace_close_matching = false; bool brace_close_mismatch = false; - if (brace_matching_enabled) { + if (brace_matching_enabled && cursor.line >= 0 && cursor.line < text.size() && cursor.column >= 0) { if (cursor.column < text[cursor.line].length()) { //check for open