Fail if HildonFontSelectionDialog:family is set to NULL
authorClaudio Saavedra <csaavedra@igalia.com>
Wed, 29 Apr 2009 10:38:01 +0000 (13:38 +0300)
committerClaudio Saavedra <csaavedra@igalia.com>
Wed, 29 Apr 2009 16:42:07 +0000 (19:42 +0300)
* src/hildon-font-selection-dialog.c
(hildon_font_selection_dialog_set_property): Fail when the "family"
property is set to NULL.

ChangeLog
src/hildon-font-selection-dialog.c

index e1057f1..4837a36 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-29  Claudio Saavedra  <csaavedra@igalia.com>
+
+       * 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  <csaavedra@igalia.com>
 
        * src/hildon-color-chooser.c (hildon_color_chooser_set_color): Add
index a486a41..175edc2 100644 (file)
@@ -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);