[test] Return early on error.

This commit is contained in:
Egor Pugin 2021-01-05 15:37:43 +03:00
parent 337742f9a5
commit ca514ad91e

View File

@ -317,6 +317,8 @@ bool PangoFontInfo::GetSpacingProperties(const std::string& utf8_char,
int* x_bearing, int* x_advance) const {
// Convert to equivalent PangoFont structure
PangoFont* font = ToPangoFont();
if (!font)
return false;
// Find the glyph index in the font for the supplied utf8 character.
int total_advance = 0;
int min_bearing = 0;