diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-12-12 12:15:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-12 12:15:55 +0100 |
commit | ee11b0eda7169fec9f2868b6cc3fe768a7107fcb (patch) | |
tree | 399423963d7d71e3f913d8ae0987184b7637f8b5 | |
parent | 7c580261c7fe18a4d56227a75883a4e1ce460e73 (diff) | |
parent | 776ae18d64d1f7b625a9de9c095cdd667e75b42a (diff) |
Merge pull request #34298 from timothyqiu/lines-32736
Fixes crash after remove_line in RichTextLabel
-rw-r--r-- | scene/gui/rich_text_label.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 0331046492..abca865ae0 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1701,6 +1701,9 @@ bool RichTextLabel::remove_line(const int p_line) { if (!was_newline) { current_frame->lines.remove(p_line); + if (current_frame->lines.size() == 0) { + current_frame->lines.resize(1); + } } if (p_line == 0 && current->subitems.size() > 0) |