From: Dirk-Jan C. Binnema Date: Fri, 20 Apr 2007 06:05:00 +0000 (+0000) Subject: * check the result of modest_account_mgr_get_from_string X-Git-Tag: git_migration_finished~3852 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=134d5d4fb3ffcbd97564794cf489936f9b3581ab;hp=ff83139654ddf5b8e297b75ce43f7c201214920e * check the result of modest_account_mgr_get_from_string (so we won't crash when are no accounts defined yet) pmo-trunk-r1603 --- diff --git a/src/modest-main.c b/src/modest-main.c index 3da5ae3..87dbf0d 100644 --- a/src/modest-main.c +++ b/src/modest-main.c @@ -121,7 +121,7 @@ main (int argc, char *argv[]) return MODEST_ERR_INIT; } - + account_or_default = check_account (account); g_free (account); diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 3dad6f4..f90427c 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -307,8 +307,12 @@ modest_ui_actions_on_new_msg (GtkAction *action, ModestWindow *win) } from_str = modest_account_mgr_get_from_string (modest_runtime_get_account_mgr(), account_name); + if (!from_str) { + g_printerr ("modest: failed get from string for '%s'\n", account_name); + goto cleanup; + } - msg = modest_tny_msg_new ("", from_str, "", "", "", "", NULL); + msg = modest_tny_msg_new ("", from_str, "", "", "", "", NULL); if (!msg) { g_printerr ("modest: failed to create new msg\n"); goto cleanup; @@ -647,7 +651,11 @@ void modest_ui_actions_on_send_receive (GtkAction *action, ModestWindow *win) { gchar *account_name; + + g_message ("online? %s", + tny_device_is_online(modest_runtime_get_device()) ? "yes":"no"); + account_name = g_strdup(modest_window_get_active_account(MODEST_WINDOW(win))); if (!account_name)