diff --git a/es-core/src/resources/Font.cpp b/es-core/src/resources/Font.cpp index c04531ffb..a3a426550 100644 --- a/es-core/src/resources/Font.cpp +++ b/es-core/src/resources/Font.cpp @@ -760,6 +760,9 @@ std::vector Font::shapeText(const std::string& text) lastCursor = textCursor; const unsigned int unicode {Utils::String::chars2Unicode(text, textCursor)}; Glyph* currGlyph {getGlyph(unicode)}; + // Extra precaution in case the font is really broken. + if (currGlyph == nullptr) + continue; byteLength = textCursor - lastCursor; if (unicode == '\'' || unicode == '\n' || currGlyph->fontHB == nullptr) {