Fix T67117: Font thumbnails crash to desktop

We were missing a null pointer check for invalid fonts.
This commit is contained in:
Sebastian Parborg 2019-07-24 11:26:21 +02:00 • committed by Brecht Van Lommel
parent 3c9a7d0652
commit db15b23745

View file

@ -96,7 +96,7 @@ KerningCacheBLF *blf_kerning_cache_new(FontBLF *font)
.x = 0,
.y = 0,
};
if (g_prev && FT_Get_Kerning(font->face, g_prev->idx, g->idx, kc->mode, &delta) == 0) {
if (g && g_prev && FT_Get_Kerning(font->face, g_prev->idx, g->idx, kc->mode, &delta) == 0) {
kc->table[i][j] = (int)delta.x >> 6;
}
else {