Fixed crash in djui_unicode_get_base_char()
This commit is contained in:
parent
83b14690c5
commit
4e9dd6a127
|
@ -365,6 +365,7 @@ void djui_unicode_cleanup_end(char* text) {
|
||||||
char djui_unicode_get_base_char(char* text) {
|
char djui_unicode_get_base_char(char* text) {
|
||||||
if ((u8)*text < ' ') { return '?'; }
|
if ((u8)*text < ' ') { return '?'; }
|
||||||
if ((u8)*text < 128) { return *text; }
|
if ((u8)*text < 128) { return *text; }
|
||||||
|
if (!sCharMap) { return '?'; }
|
||||||
u64 key = convert_unicode_char_to_u64(text);
|
u64 key = convert_unicode_char_to_u64(text);
|
||||||
struct SmCodeGlyph* glyph = hmap_get(sCharMap, key);
|
struct SmCodeGlyph* glyph = hmap_get(sCharMap, key);
|
||||||
return (glyph != NULL || ((u8)glyph->base < (u8)'!')) ? glyph->base : '?';
|
return (glyph != NULL || ((u8)glyph->base < (u8)'!')) ? glyph->base : '?';
|
||||||
|
|
Loading…
Reference in New Issue