From f94051e75275e98f312138a53c3aea4e1888f915 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 27 Feb 2026 08:26:33 +0530 Subject: [PATCH] Be a little more defensive --- kitty/freetype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/freetype.c b/kitty/freetype.c index 023b963f7..697cb35ee 100644 --- a/kitty/freetype.c +++ b/kitty/freetype.c @@ -474,7 +474,7 @@ cell_metrics(PyObject *s) { unsigned int glyph_id_for_codepoint(const PyObject *s, char_type cp) { - return FT_Get_Char_Index(((Face*)s)->face, cp); + return s ? FT_Get_Char_Index(((Face*)s)->face, cp) : 0; } typedef enum { NOT_COLORED, CBDT_COLORED, COLR_V0_COLORED, COLR_V1_COLORED } GlyphColorType;