Skip to content

Commit

Permalink
Quick fix of crash caused by missing sanity checks.
Browse files Browse the repository at this point in the history
Closes #68154
  • Loading branch information
Eoin-ONeill-Yokai committed Dec 6, 2022
1 parent f3e6750 commit 24f230d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scene/gui/code_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,10 @@ void CodeEdit::do_unindent() {
int cl = get_caret_line(c);
const String &line = get_line(cl);

if ((cc - 1) >= line.size()) {
continue;
}

if (line[cc - 1] == '\t') {
remove_text(cl, cc - 1, cl, cc);
set_caret_column(MAX(0, cc - 1), c == 0, c);
Expand Down

0 comments on commit 24f230d

Please sign in to comment.