aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/bbdb
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/bbdb')
-rw-r--r--plugins/bbdb/bbdb.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/bbdb/bbdb.c b/plugins/bbdb/bbdb.c
index a9056b1d34..d9b1967f2e 100644
--- a/plugins/bbdb/bbdb.c
+++ b/plugins/bbdb/bbdb.c
@@ -313,7 +313,8 @@ bbdb_do_it (EBook *book, const gchar *name, const gchar *email)
{
gchar *query_string, *delim, *temp_name = NULL;
EBookQuery *query;
- GList *contacts, *l;
+ GList *contacts = NULL, *l;
+ gboolean status;
EContact *contact;
GError *error = NULL;
@@ -336,10 +337,10 @@ bbdb_do_it (EBook *book, const gchar *name, const gchar *email)
query = e_book_query_from_string (query_string);
g_free (query_string);
- e_book_get_contacts (book, query, &contacts, NULL);
+ status = e_book_get_contacts (book, query, &contacts, NULL);
if (query)
e_book_query_unref (query);
- if (contacts != NULL) {
+ if (contacts != NULL || !status) {
for (l = contacts; l != NULL; l = l->next)
g_object_unref ((GObject *)l->data);
g_list_free (contacts);
@@ -365,15 +366,15 @@ bbdb_do_it (EBook *book, const gchar *name, const gchar *email)
query = e_book_query_from_string (query_string);
g_free (query_string);
- e_book_get_contacts (book, query, &contacts, NULL);
+ status = e_book_get_contacts (book, query, &contacts, NULL);
if (query)
e_book_query_unref (query);
- if (contacts != NULL) {
+ if (contacts != NULL || !status) {
/* FIXME: If there's more than one contact with this
name, just give up; we're not smart enough for
this. */
- if (contacts->next != NULL) {
+ if (!status || contacts->next != NULL) {
for (l = contacts; l != NULL; l = l->next)
g_object_unref ((GObject *)l->data);
g_list_free (contacts);