From 7cb2ed6c67b09ca0f2ece3ca4d56b60e97b5ac6f Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 29 Nov 2013 11:20:32 +0000 Subject: pine-importer: Fix a crash when importing with no existing address books This is a theoretical crash (not actually reproduced), caused by the client variable being NULL if no address books exist. Instead of crashing, gracefully exit with an error. Found by scan-build. https://bugzilla.gnome.org/719540 --- mail/importers/pine-importer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c index f5ae3fdd28..fe636204c4 100644 --- a/mail/importers/pine-importer.c +++ b/mail/importers/pine-importer.c @@ -198,6 +198,11 @@ import_contacts (void) source = E_SOURCE (list->data); client = e_book_client_connect_sync (source, NULL, &error); + } else { + /* No address books exist. */ + g_warning ("%s: No address books exist.", G_STRFUNC); + fclose (fp); + return; } g_list_free_full (list, (GDestroyNotify) g_object_unref); -- cgit v1.2.3