diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2019-12-12 16:35:50 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2019-12-12 16:35:50 +0800 |
commit | 776ae18d64d1f7b625a9de9c095cdd667e75b42a (patch) | |
tree | 2fc150587a085d662ee51b28b2797e71aed87925 | |
parent | 37d164e24e22633985a6555121a992abf1b130e0 (diff) |
Fixes crash after remove_line in RichTextLabel
`ItemFrame` always have a line.
-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) |