summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasiliy Makarov <drmoriarty.0@gmail.com>2019-03-05 18:23:25 +0300
committerVasiliy Makarov <drmoriarty.0@gmail.com>2019-03-05 18:27:37 +0300
commita3d9b7d9162259c26d01ce659b49119751a5195a (patch)
treee02b34ba89f8c3e0d8ac3e27653bbc4c3e1d0bd4
parent80618700ca668a595fd214ca8db43a69ca2a8b67 (diff)
Check cursor line and column
Added a trivial check if cursor.line and cursor.column are valid. Fix #26245
-rw-r--r--scene/gui/text_edit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index f38bc62a3c..2bf2364873 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