[gnome-disk-utility] fix some criticals where we tried to access non-existant widgets
- From: David Zeuthen <davidz src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-disk-utility] fix some criticals where we tried to access non-existant widgets
- Date: Mon, 30 Mar 2009 17:29:55 -0400 (EDT)
commit f3d83a789106803b0de2e60bf29447f07d16a54d
Author: David Zeuthen <davidz redhat com>
Date: Mon Mar 30 17:27:03 2009 -0400
fix some criticals where we tried to access non-existant widgets
---
src/gdu-gtk/gdu-gtk.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/gdu-gtk/gdu-gtk.c b/src/gdu-gtk/gdu-gtk.c
index 235948f..fab6ba0 100644
--- a/src/gdu-gtk/gdu-gtk.c
+++ b/src/gdu-gtk/gdu-gtk.c
@@ -479,8 +479,16 @@ gdu_util_dialog_secret_update (DialogSecretData *data)
current = gtk_entry_get_text (GTK_ENTRY (data->password_entry));
else
current = NULL;
- new = gtk_entry_get_text (GTK_ENTRY (data->password_entry_new));
- verify = gtk_entry_get_text (GTK_ENTRY (data->password_entry_verify));
+
+ if (data->password_entry_new != NULL)
+ new = gtk_entry_get_text (GTK_ENTRY (data->password_entry_new));
+ else
+ new = NULL;
+
+ if (data->password_entry_verify != NULL)
+ verify = gtk_entry_get_text (GTK_ENTRY (data->password_entry_verify));
+ else
+ verify = NULL;
if (g_strcmp0 (new, verify) != 0) {
gtk_widget_show (data->warning_hbox);
@@ -502,7 +510,8 @@ gdu_util_dialog_secret_update (DialogSecretData *data)
g_free (s);
gtk_widget_set_sensitive (data->button, FALSE);
} else {
- gtk_widget_hide (data->warning_hbox);
+ if (data->warning_hbox != NULL)
+ gtk_widget_hide (data->warning_hbox);
gtk_widget_set_sensitive (data->button, g_strcmp0 (new, "") != 0);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]