inspector: Prevent crash when hint style isn't set

The hint style can be null, e.g. on macOS.
This commit is contained in:
Mat
2024-05-20 22:50:04 +03:00
parent a2fc5eb3f8
commit f426ac6f54

View File

@@ -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;
} }