[gnome-power-manager] Fix a compile error for a condition that shouldn't happen



commit f744bedad026a7190391d750c28c2570473e4fb4
Author: Richard Hughes <richard hughsie com>
Date:   Sun Jul 19 11:29:49 2009 +0100

    Fix a compile error for a condition that shouldn't happen

 src/gpm-prefs-core.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index b664b5a..c8f4067 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -262,7 +262,7 @@ static void
 gpm_prefs_action_combo_changed_cb (GtkWidget *widget, GpmPrefs *prefs)
 {
 	gchar *value;
-	const gchar *action;
+	const gchar *action = NULL;
 	gchar *gpm_pref_key;
 
 	value = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget));
@@ -282,6 +282,13 @@ gpm_prefs_action_combo_changed_cb (GtkWidget *widget, GpmPrefs *prefs)
 	}
 
 	g_free (value);
+
+	/* nothing matched */
+	if (action == NULL) {
+		egg_warning ("could not match %s", value);
+		return;
+	}
+
 	gpm_pref_key = (char *) g_object_get_data (G_OBJECT (widget), "conf_key");
 	egg_debug ("Changing %s to %s", gpm_pref_key, action);
 	gconf_client_set_string (prefs->priv->conf, gpm_pref_key, action, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]