浏览代码

Merge pull request #34298 from timothyqiu/lines-32736

Fixes crash after remove_line in RichTextLabel
Rémi Verschelde 5 年之前
父节点
当前提交
ee11b0eda7
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      scene/gui/rich_text_label.cpp

+ 3 - 0
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)