* check the result of modest_account_mgr_get_from_string
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Fri, 20 Apr 2007 06:05:00 +0000 (06:05 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Fri, 20 Apr 2007 06:05:00 +0000 (06:05 +0000)
  (so we won't crash when are no accounts defined yet)

pmo-trunk-r1603

src/modest-main.c
src/modest-ui-actions.c

index 3da5ae3..87dbf0d 100644 (file)
@@ -121,7 +121,7 @@ main (int argc, char *argv[])
                return MODEST_ERR_INIT;
                
        }
-
+       
        account_or_default = check_account (account);
        g_free (account);
        
index 3dad6f4..f90427c 100644 (file)
@@ -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)