* check some parameters (give BUG: warnings instead of crashing)
[modest] / src / modest-account-mgr-helpers.c
index 5872397..da7f1f1 100644 (file)
@@ -585,6 +585,10 @@ modest_account_mgr_set_first_account_as_default  (ModestAccountMgr *self)
 {
        gboolean result = FALSE;
        GSList *account_names = modest_account_mgr_account_names (self, TRUE /* only enabled */);
+
+       /* Return TRUE if there is no account */
+       if (!account_names)
+               return TRUE;
                
        /* Get the first one, alphabetically, by title: */
        GSList* list_sorted = g_slist_sort (account_names,