From 4e9dd6a127e1476cee31728a158a9c8fbcb2e98d Mon Sep 17 00:00:00 2001 From: MysterD Date: Wed, 8 Nov 2023 13:00:57 -0800 Subject: [PATCH] Fixed crash in djui_unicode_get_base_char() --- src/pc/djui/djui_unicode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pc/djui/djui_unicode.c b/src/pc/djui/djui_unicode.c index c6343648..8ffd60c5 100644 --- a/src/pc/djui/djui_unicode.c +++ b/src/pc/djui/djui_unicode.c @@ -365,6 +365,7 @@ void djui_unicode_cleanup_end(char* text) { char djui_unicode_get_base_char(char* text) { if ((u8)*text < ' ') { return '?'; } if ((u8)*text < 128) { return *text; } + if (!sCharMap) { return '?'; } u64 key = convert_unicode_char_to_u64(text); struct SmCodeGlyph* glyph = hmap_get(sCharMap, key); return (glyph != NULL || ((u8)glyph->base < (u8)'!')) ? glyph->base : '?';