summaryrefslogtreecommitdiff
path: root/gtk/gtkfontbutton.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-08-15 15:15:45 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-08-15 15:15:45 -0400
commit59fc2f0ac107c9affe63c9e5c26b9dee049ad424 (patch)
tree48cfa9a681908d3278cc86f331ec0e1b33146dd3 /gtk/gtkfontbutton.c
parent1815790bd3c9d4c275976b3fae4da1bff6308dc0 (diff)
downloadgtk+-59fc2f0ac107c9affe63c9e5c26b9dee049ad424.tar.gz
GtkFontButton: Avoid criticals
The font_family and font_face members may be NULL, and we shouldn't cause critical warnings in that case.
Diffstat (limited to 'gtk/gtkfontbutton.c')
-rw-r--r--gtk/gtkfontbutton.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c
index cb0822f93e..867d82fa55 100644
--- a/gtk/gtkfontbutton.c
+++ b/gtk/gtkfontbutton.c
@@ -1146,8 +1146,14 @@ gtk_font_button_update_font_info (GtkFontButton *font_button)
const gchar *face_name;
gchar *family_style;
- fam_name = pango_font_family_get_name (priv->font_family);
- face_name = pango_font_face_get_face_name (priv->font_face);
+ if (priv->font_family)
+ fam_name = pango_font_family_get_name (priv->font_family);
+ else
+ fam_name = _("None");
+ if (priv->font_face)
+ face_name = pango_font_face_get_face_name (priv->font_face);
+ else
+ face_name = "";
if (priv->show_style)
family_style = g_strconcat (fam_name, " ", face_name, NULL);