You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Check for valid DynamicFontData before duplicate
This commit is contained in:
@@ -830,7 +830,9 @@ Ref<Texture> EditorFontPreviewPlugin::generate_from_path(const String &p_path, c
|
|||||||
sampled_font.instance();
|
sampled_font.instance();
|
||||||
if (res->is_class("DynamicFont")) {
|
if (res->is_class("DynamicFont")) {
|
||||||
Ref<DynamicFont> font = res;
|
Ref<DynamicFont> font = res;
|
||||||
sampled_font->set_font_data(font->get_font_data()->duplicate());
|
if (font->get_font_data().is_valid()) {
|
||||||
|
sampled_font->set_font_data(font->get_font_data()->duplicate());
|
||||||
|
}
|
||||||
for (int i = 0; i < font->get_fallback_count(); i++) {
|
for (int i = 0; i < font->get_fallback_count(); i++) {
|
||||||
sampled_font->add_fallback(font->get_fallback(i)->duplicate());
|
sampled_font->add_fallback(font->get_fallback(i)->duplicate());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user