From 776ae18d64d1f7b625a9de9c095cdd667e75b42a Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 12 Dec 2019 16:35:50 +0800 Subject: Fixes crash after remove_line in RichTextLabel `ItemFrame` always have a line. --- scene/gui/rich_text_label.cpp | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit v1.2.3