diff options
author | Eric M <itsjusteza@gmail.com> | 2023-01-11 22:40:05 +1000 |
---|---|---|
committer | Eric M <itsjusteza@gmail.com> | 2023-01-11 22:52:37 +1000 |
commit | 1d30653efbe7ad72f7e0c376c7831f5354d93fee (patch) | |
tree | b5427003ecd7ca670853b58ed8fb5da7ec791719 /scene/gui | |
parent | 269fa200d04ae96b0114b788e18df638c5fb164b (diff) |
Fix crash in CodeEdit when caret column exceeds line length.
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/code_edit.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index 680e4260e7..7539810feb 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -2899,6 +2899,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() { const int caret_line = get_caret_line(); const int caret_column = get_caret_column(); const String line = get_line(caret_line); + ERR_FAIL_INDEX_MSG(caret_column - 1, line.length(), "Caret column exceeds line length."); if (caret_column > 0 && line[caret_column - 1] == '(' && !code_completion_forced) { cancel_code_completion(); |