[network-manager-applet] applet: check whether gtk_combo_box_get_active_iter() succeeds (rh #632123)
- From: Jiří Klimeš <jklimes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet] applet: check whether gtk_combo_box_get_active_iter() succeeds (rh #632123)
- Date: Thu, 16 Dec 2010 13:48:00 +0000 (UTC)
commit 6d6b3c466a6e400885b4256601fe4e478ca64269
Author: JiÅ?à KlimeÅ¡ <jklimes redhat com>
Date: Wed Dec 15 16:51:27 2010 +0100
applet: check whether gtk_combo_box_get_active_iter() succeeds (rh #632123)
This commit only fixes the symptom of the problem (the crash). The actual fix
is NM commit b3800183b434bbaf90d627a2e44c631cf04e8b71.
src/wireless-dialog.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/src/wireless-dialog.c b/src/wireless-dialog.c
index 582f7ba..ee9cb0a 100644
--- a/src/wireless-dialog.c
+++ b/src/wireless-dialog.c
@@ -370,7 +370,11 @@ connection_combo_changed (GtkWidget *combo,
char *utf8_ssid;
GtkWidget *widget;
- gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter);
+ if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter)) {
+ g_warning ("%s: no active connection combo box item.", __func__);
+ return;
+ }
+
model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
if (priv->connection)
@@ -587,7 +591,10 @@ device_combo_changed (GtkWidget *combo,
GtkTreeIter iter;
GtkTreeModel *model;
- gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter);
+ if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter)) {
+ g_warning ("%s: no active device combo box item.", __func__);
+ return;
+ }
model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
g_object_unref (priv->device);
@@ -1261,8 +1268,8 @@ nma_wireless_dialog_get_connection (NMAWirelessDialog *self,
if (!is_system_connection (self)) {
/* Fill security */
model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->sec_combo));
- gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->sec_combo), &iter);
- gtk_tree_model_get (model, &iter, S_SEC_COLUMN, &sec, -1);
+ if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->sec_combo), &iter))
+ gtk_tree_model_get (model, &iter, S_SEC_COLUMN, &sec, -1);
if (sec) {
wireless_security_fill_connection (sec, connection);
wireless_security_unref (sec);
@@ -1386,7 +1393,11 @@ nma_wireless_dialog_nag_user (NMAWirelessDialog *self)
/* Ask the security method if it wants to nag the user. */
model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
- gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter);
+ if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter)) {
+ g_warning ("%s: no active security combo box item.", __func__);
+ return NULL;
+ }
+
gtk_tree_model_get (model, &iter, S_SEC_COLUMN, &sec, -1);
if (sec)
return wireless_security_nag_user (sec);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]