Merge pull request #51673 from Vignesh1-art/master

Fixed crash executing TextEdit.new().set_draw_control_chars(true)
This commit is contained in:
Rémi Verschelde 2021-08-16 14:27:47 +02:00 committed by GitHub
commit 1ee61a501f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4332,7 +4332,9 @@ bool TextEdit::is_highlight_all_occurrences_enabled() const {
void TextEdit::set_draw_control_chars(bool p_draw_control_chars) { void TextEdit::set_draw_control_chars(bool p_draw_control_chars) {
if (draw_control_chars != p_draw_control_chars) { if (draw_control_chars != p_draw_control_chars) {
draw_control_chars = p_draw_control_chars; draw_control_chars = p_draw_control_chars;
menu->set_item_checked(menu->get_item_index(MENU_DISPLAY_UCC), draw_control_chars); if (menu) {
menu->set_item_checked(menu->get_item_index(MENU_DISPLAY_UCC), draw_control_chars);
}
text.set_draw_control_chars(draw_control_chars); text.set_draw_control_chars(draw_control_chars);
text.invalidate_all(); text.invalidate_all();
update(); update();