From 6215f7990598eed1a7212ae6d08c61442c622fb8 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 12 May 2011 08:26:58 +0200 Subject: Cannot send message with just enabled account Everything in UI seemed as working fine, but the message is just lost, even there was printed a runtime warning on the console. This is fixing couple things along this issue: - differentiate between NULL and invalid pointers/objects in new e_mail_folder_uri_...() functions - report error to UI if mail_session_send_to_thread() fails to find corresponding transport service - call e_mail_store_add_by_account() in mail_store_load_accounts() (a side-effect of this change is no code duplication and unified processing of the same action) --- mail/e-mail-session-utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mail/e-mail-session-utils.c') diff --git a/mail/e-mail-session-utils.c b/mail/e-mail-session-utils.c index b307fdc15c..ae9bd96a39 100644 --- a/mail/e-mail-session-utils.c +++ b/mail/e-mail-session-utils.c @@ -406,7 +406,12 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple, service = camel_session_get_service ( CAMEL_SESSION (session), context->transport_uid); - g_return_if_fail (CAMEL_IS_TRANSPORT (service)); + if (!CAMEL_IS_TRANSPORT (service)) { + g_simple_async_result_set_error (simple, + CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_URL_INVALID, + _("Cannot get transport service for account '%s'"), context->transport_uid); + return; + } /* XXX This API does not allow for cancellation. */ if (!camel_service_connect_sync (service, &error)) { -- cgit