summaryrefslogtreecommitdiff
path: root/scene/resources/dynamic_font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/dynamic_font.cpp')
-rw-r--r--scene/resources/dynamic_font.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp
index 78a5571bf0..1edae01754 100644
--- a/scene/resources/dynamic_font.cpp
+++ b/scene/resources/dynamic_font.cpp
@@ -573,7 +573,11 @@ DynamicFontAtSize::~DynamicFontAtSize(){
void DynamicFont::set_font_data(const Ref<DynamicFontData>& p_data) {
data=p_data;
- data_at_size=data->_get_dynamic_font_at_size(size);
+ if (data.is_valid())
+ data_at_size=data->_get_dynamic_font_at_size(size);
+ else
+ data_at_size=Ref<DynamicFontAtSize>();
+
emit_changed();
}