Handle the case where there's no font char infos.
Fixes i3bar crash with some fonts (and possible i3 crash too). Thanks to xeen for reporting the issue.
This commit is contained in:
parent
1a3b82eb02
commit
0e6d1909b8
|
@ -64,6 +64,9 @@ i3Font load_font(const char *pattern, const bool fallback) {
|
|||
errx(EXIT_FAILURE, "Could not load font \"%s\"", pattern);
|
||||
|
||||
/* Get the font table, if possible */
|
||||
if (xcb_query_font_char_infos_length(font.info) == 0)
|
||||
font.table = NULL;
|
||||
else
|
||||
font.table = xcb_query_font_char_infos(font.info);
|
||||
|
||||
/* Calculate the font height */
|
||||
|
|
Loading…
Reference in New Issue