From 6ce173f5803379a56b57c37949e9424a496617e8 Mon Sep 17 00:00:00 2001 From: Shi Pu Date: Thu, 5 Jan 2006 05:55:25 +0000 Subject: add a not NULL-pointer check before using lud->scope. 2006-01-04 Shi Pu * gui/component/addressbook-config.c (eabc_details_search): add a not NULL-pointer check before using lud->scope. svn path=/trunk/; revision=31056 --- addressbook/gui/component/addressbook-config.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c index 310d433694..b8822848f7 100644 --- a/addressbook/gui/component/addressbook-config.c +++ b/addressbook/gui/component/addressbook-config.c @@ -890,17 +890,19 @@ eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, s g_signal_connect (sdialog->rootdn, "changed", G_CALLBACK (rootdn_changed_cb), sdialog); sdialog->scope_optionmenu = glade_xml_get_widget (gui, "scope-optionmenu"); - switch (lud->lud_scope) { - case LDAP_SCOPE_BASE: - sdialog->scope = ADDRESSBOOK_LDAP_SCOPE_BASE; - break; - default: - case LDAP_SCOPE_ONELEVEL: - sdialog->scope = ADDRESSBOOK_LDAP_SCOPE_ONELEVEL; - break; - case LDAP_SCOPE_SUBTREE: - sdialog->scope = ADDRESSBOOK_LDAP_SCOPE_SUBTREE; - break; + if (lud) { + switch (lud->lud_scope) { + case LDAP_SCOPE_BASE: + sdialog->scope = ADDRESSBOOK_LDAP_SCOPE_BASE; + break; + default: + case LDAP_SCOPE_ONELEVEL: + sdialog->scope = ADDRESSBOOK_LDAP_SCOPE_ONELEVEL; + break; + case LDAP_SCOPE_SUBTREE: + sdialog->scope = ADDRESSBOOK_LDAP_SCOPE_SUBTREE; + break; + } } gtk_option_menu_set_history (GTK_OPTION_MENU(sdialog->scope_optionmenu), sdialog->scope); g_signal_connect(sdialog->scope_optionmenu, "changed", G_CALLBACK(scope_optionmenu_changed_cb), sdialog); -- cgit