From 86f946043adc8823934697756fde4eb2ae66d0e1 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Mon, 4 Oct 2021 22:47:28 +0300 Subject: [PATCH] Safeguard against BitMap fonts in the CanvasItem editor Co-authored-by: ArrowInAKnee (cherry picked from commit 8fe6fceb02e42ff0fc490173216f795ef118d809) --- editor/plugins/canvas_item_editor_plugin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 0306fb37593..64514e0b31d 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -4081,8 +4081,10 @@ void CanvasItemEditor::_notification(int p_what) { anchor_mode_button->set_icon(get_icon("Anchor", "EditorIcons")); Ref font = zoom_reset->get_font("font")->duplicate(false); - font->set_outline_size(1); - font->set_outline_color(Color(0, 0, 0)); + if (font.is_valid()) { + font->set_outline_size(1); + font->set_outline_color(Color(0, 0, 0)); + } zoom_reset->add_font_override("font", font); zoom_reset->add_color_override("font_color", Color(1, 1, 1)); }