aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/exchange-operations/exchange-contacts.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-10-09 02:22:50 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-10-09 02:22:50 +0800
commit6cf6c0cada7a95853daa122032dbee3a823c4953 (patch)
treed6f9c06fd53b063bf0ed0c496e4413dbbd380137 /plugins/exchange-operations/exchange-contacts.c
parent48edab7b48fc3965701cda4a5d743a7d7053114f (diff)
downloadgsoc2013-evolution-6cf6c0cada7a95853daa122032dbee3a823c4953.tar
gsoc2013-evolution-6cf6c0cada7a95853daa122032dbee3a823c4953.tar.gz
gsoc2013-evolution-6cf6c0cada7a95853daa122032dbee3a823c4953.tar.bz2
gsoc2013-evolution-6cf6c0cada7a95853daa122032dbee3a823c4953.tar.lz
gsoc2013-evolution-6cf6c0cada7a95853daa122032dbee3a823c4953.tar.xz
gsoc2013-evolution-6cf6c0cada7a95853daa122032dbee3a823c4953.tar.zst
gsoc2013-evolution-6cf6c0cada7a95853daa122032dbee3a823c4953.zip
** Fix for bug #530606
2008-10-08 Milan Crha <mcrha@redhat.com> ** Fix for bug #530606 * exchange-contacts.c: (e_exchange_contacts_get_contacts), (e_exchange_contacts_pcontacts_on_change), (e_exchange_contacts_pcontacts), (e_exchange_contacts_check), (e_exchange_contacts_commit): * exchange-account-setup.c: (btn_chpass_clicked), (btn_dass_clicked), (btn_fsize_clicked), (org_gnome_exchange_show_folder_size_factory): * exchange-calendar.c: (e_exchange_calendar_get_calendars), (e_exchange_calendar_pcalendar_on_change), (e_exchange_calendar_pcalendar), (e_exchange_calendar_check), (e_exchange_calendar_commit): Check validity of returned pointer before using it. svn path=/trunk/; revision=36579
Diffstat (limited to 'plugins/exchange-operations/exchange-contacts.c')
-rw-r--r--plugins/exchange-operations/exchange-contacts.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/plugins/exchange-operations/exchange-contacts.c b/plugins/exchange-operations/exchange-contacts.c
index 8d2b2f7da9..5fe233dec0 100644
--- a/plugins/exchange-operations/exchange-contacts.c
+++ b/plugins/exchange-operations/exchange-contacts.c
@@ -70,6 +70,8 @@ e_exchange_contacts_get_contacts (void)
gchar *uri_prefix, *ruri;
account = exchange_operations_get_exchange_account ();
+ if (!account)
+ return NULL;
uri_prefix = g_strconcat ("exchange://", account->account_filename, "/;", NULL);
prefix_len = strlen (uri_prefix);
@@ -108,6 +110,8 @@ e_exchange_contacts_pcontacts_on_change (GtkTreeView *treeview, ESource *source)
gchar *ruri;
account = exchange_operations_get_exchange_account ();
+ if (!account)
+ return;
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
gtk_tree_selection_get_selected(selection, &model, &iter);
@@ -241,9 +245,12 @@ e_exchange_contacts_pcontacts (EPlugin *epl, EConfigHookItemFactoryData *data)
conlist = e_exchange_contacts_get_contacts ();
- for (i=0; i<conlist->len; ++i) {
- ruri = g_ptr_array_index (conlist, i);
- exchange_operations_cta_add_node_to_tree (ts_pcontacts, NULL, ruri);
+ if (conlist) {
+ for (i = 0; i < conlist->len; i++) {
+ ruri = g_ptr_array_index (conlist, i);
+ exchange_operations_cta_add_node_to_tree (ts_pcontacts, NULL, ruri);
+ }
+ g_ptr_array_free (conlist, TRUE);
}
cr_contacts = gtk_cell_renderer_text_new ();
@@ -293,7 +300,6 @@ e_exchange_contacts_pcontacts (EPlugin *epl, EConfigHookItemFactoryData *data)
g_free (sruri);
}
- g_ptr_array_free (conlist, TRUE);
g_object_unref (ts_pcontacts);
return vb_pcontacts;
}
@@ -329,6 +335,8 @@ e_exchange_contacts_check (EPlugin *epl, EConfigHookPageCheckData *data)
}
account = exchange_operations_get_exchange_account ();
+ if (!account)
+ return FALSE;
if (!rel_uri) {
GConfClient *client;
@@ -424,7 +432,7 @@ e_exchange_contacts_commit (EPlugin *epl, EConfigTarget *target)
}
account = exchange_operations_get_exchange_account ();
- if (!is_exchange_personal_folder (account, uri_text))
+ if (!account || !is_exchange_personal_folder (account, uri_text))
return;
windows_domain = exchange_account_get_windows_domain (account);