From 89382ebff7070d691e673da032dfb9ca56f80a95 Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Wed, 29 Apr 2009 13:38:01 +0300 Subject: [PATCH] Fail if HildonFontSelectionDialog:family is set to NULL * src/hildon-font-selection-dialog.c (hildon_font_selection_dialog_set_property): Fail when the "family" property is set to NULL. --- ChangeLog | 6 ++++++ src/hildon-font-selection-dialog.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1057f1..4837a36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-29 Claudio Saavedra + + * src/hildon-font-selection-dialog.c + (hildon_font_selection_dialog_set_property): Fail when the "family" + property is set to NULL. + 2009-04-28 Claudio Saavedra * src/hildon-color-chooser.c (hildon_color_chooser_set_color): Add diff --git a/src/hildon-font-selection-dialog.c b/src/hildon-font-selection-dialog.c index a486a41..175edc2 100644 --- a/src/hildon-font-selection-dialog.c +++ b/src/hildon-font-selection-dialog.c @@ -352,7 +352,7 @@ hildon_font_selection_dialog_set_property (GObject *object, GParamSpec *pspec) { gint i, size; - const gchar *str; + const gchar *family; gboolean b; GdkColor *color = NULL; GdkColor black; @@ -365,10 +365,11 @@ hildon_font_selection_dialog_set_property (GObject *object, switch (prop_id) { case PROP_FAMILY: - str = g_value_get_string (value); + family = g_value_get_string (value); + g_return_if_fail (family != NULL); for(i = 0; i < priv->n_families; i++) { - if (strcmp (str, pango_font_family_get_name (priv->families[i])) + if (strcmp (family, pango_font_family_get_name (priv->families[i])) == 0) { gtk_combo_box_set_active (GTK_COMBO_BOX (priv->cbx_font_type), i); -- 1.7.9.5