From d434a5b40a32dae6085d044550df89e9498470b4 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Tue, 31 Mar 2009 11:56:57 +0000 Subject: [PATCH] Code review fix: check return value of e_book_add_contact pmo-trunk-r8486 --- src/hildon2/modest-address-book.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/hildon2/modest-address-book.c b/src/hildon2/modest-address-book.c index 6964ed3..48dc31a 100644 --- a/src/hildon2/modest-address-book.c +++ b/src/hildon2/modest-address-book.c @@ -445,10 +445,18 @@ commit_contact(EContact * contact, gboolean is_new) if (OSSO_ABOOK_IS_CONTACT (contact)) { osso_abook_contact_commit(OSSO_ABOOK_CONTACT(contact), is_new, book, NULL); } else { - if (is_new) - e_book_add_contact (book, contact, NULL); - else - e_book_commit_contact (book, contact, NULL); + GError *err = NULL; + if (is_new) { + if (!e_book_add_contact (book, contact, &err)) { + g_warning ("Failed to add contact: %s", err->message); + g_error_free (err); + } + } else { + if (!e_book_commit_contact (book, contact, &err)) { + g_warning ("Failed to commit contact: %s", err->message); + g_error_free (err); + } + } } #endif /* MODEST_ABOOK_API < 2 */ } -- 1.7.9.5