From bec1dcb6f670e163196fded19964b7a6d0dc1570 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 21 May 2021 10:22:20 +0800 Subject: [PATCH] Fix crash when using get_available_chars with invalid DynamicFontData --- scene/resources/dynamic_font.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index f235676c7d4..4ceacf73d8c 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -256,6 +256,10 @@ Size2 DynamicFontAtSize::get_char_size(CharType p_char, CharType p_next, const V } String DynamicFontAtSize::get_available_chars() const { + if (!valid) { + return ""; + } + String chars; FT_UInt gindex;