X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-widget-memory.c;h=8ad2bb9bc1101b0892cf959a217a4b301a480a6a;hb=d7c5eaa37d4f4f0a6dd316508a6c5c77a2036978;hp=76cb85339730ff1ce932dc87a17ca8265619501c;hpb=02b54fd7fc8dbc7e12d9d580ac8f7107bad5fe1b;p=modest diff --git a/src/modest-widget-memory.c b/src/modest-widget-memory.c index 76cb853..8ad2bb9 100644 --- a/src/modest-widget-memory.c +++ b/src/modest-widget-memory.c @@ -492,16 +492,22 @@ restore_settings_folder_view (ModestConf *conf, default_acc = modest_account_mgr_get_default_account (mgr); if (default_acc) { ModestAccountSettings *settings; - ModestServerAccountSettings *store_settings; const gchar *server_acc_id; settings = modest_account_mgr_load_account_settings (mgr, (const gchar*) default_acc); - store_settings = modest_account_settings_get_store_settings (settings); - server_acc_id = modest_server_account_settings_get_account_name (store_settings); - - modest_folder_view_set_account_id_of_visible_server_account (folder_view, server_acc_id); - g_object_unref (store_settings); - g_object_unref (settings); + /* If there was any problem with the settings storage + the settings could be NULL */ + if (settings) { + ModestServerAccountSettings *store_settings; + store_settings = modest_account_settings_get_store_settings (settings); + + if (store_settings) { + server_acc_id = modest_server_account_settings_get_account_name (store_settings); + modest_folder_view_set_account_id_of_visible_server_account (folder_view, server_acc_id); + g_object_unref (store_settings); + } + g_object_unref (settings); + } g_free (default_acc); } return TRUE;