inspector: Prevent crash when hint style isn't set
The hint style can be null, e.g. on macOS.
This commit is contained in:
@@ -274,7 +274,7 @@ get_font_hinting (GtkInspectorVisual *vis)
|
|||||||
{
|
{
|
||||||
hint_style = 0;
|
hint_style = 0;
|
||||||
}
|
}
|
||||||
else
|
else if (hint_style_str != NULL)
|
||||||
{
|
{
|
||||||
if (strcmp (hint_style_str, "hintnone") == 0)
|
if (strcmp (hint_style_str, "hintnone") == 0)
|
||||||
hint_style = 0;
|
hint_style = 0;
|
||||||
@@ -286,7 +286,8 @@ get_font_hinting (GtkInspectorVisual *vis)
|
|||||||
hint_style = 3;
|
hint_style = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (hint_style_str);
|
if (hint_style_str != NULL)
|
||||||
|
g_free (hint_style_str);
|
||||||
|
|
||||||
return hint_style;
|
return hint_style;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user