From: Sergio Villar Senin Date: Tue, 21 Oct 2008 15:47:42 +0000 (+0000) Subject: * Fixes NB#90487, adds a required NULL check X-Git-Tag: git_migration_finished~1119 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=827e1886270816c632c05f804891a56924915229;ds=sidebyside * Fixes NB#90487, adds a required NULL check pmo-trunk-r6137 --- diff --git a/src/hildon2/modest-connection-specific-smtp-window.c b/src/hildon2/modest-connection-specific-smtp-window.c index 4b95597..685e630 100644 --- a/src/hildon2/modest-connection-specific-smtp-window.c +++ b/src/hildon2/modest-connection-specific-smtp-window.c @@ -200,16 +200,17 @@ modest_connection_specific_smtp_window_fill_with_connections (ModestConnectionSp server_account_name = modest_account_mgr_get_connection_specific_smtp ( priv->account_manager, connection_id); - /* Add the row to the model: */ - GtkTreeIter iter; - gtk_list_store_append (liststore, &iter); - gtk_list_store_set(liststore, &iter, - MODEL_COL_ID, connection_id, - MODEL_COL_NAME, connection_name, - MODEL_COL_SERVER_ACCOUNT_NAME, server_account_name, - -1); - - g_free (server_account_name); + if (server_account_name) { + /* Add the row to the model: */ + GtkTreeIter iter; + gtk_list_store_append (liststore, &iter); + gtk_list_store_set(liststore, &iter, + MODEL_COL_ID, connection_id, + MODEL_COL_NAME, connection_name, + MODEL_COL_SERVER_ACCOUNT_NAME, server_account_name, + -1); + g_free (server_account_name); + } } iter = g_slist_next (iter); diff --git a/src/maemo/modest-connection-specific-smtp-window.c b/src/maemo/modest-connection-specific-smtp-window.c index b734983..cf2bbbb 100644 --- a/src/maemo/modest-connection-specific-smtp-window.c +++ b/src/maemo/modest-connection-specific-smtp-window.c @@ -200,16 +200,17 @@ modest_connection_specific_smtp_window_fill_with_connections (ModestConnectionSp server_account_name = modest_account_mgr_get_connection_specific_smtp ( priv->account_manager, connection_id); - /* Add the row to the model: */ - GtkTreeIter iter; - gtk_list_store_append (liststore, &iter); - gtk_list_store_set(liststore, &iter, - MODEL_COL_ID, connection_id, - MODEL_COL_NAME, connection_name, - MODEL_COL_SERVER_ACCOUNT_NAME, server_account_name, - -1); - - g_free (server_account_name); + if (server_account_name) { + /* Add the row to the model: */ + GtkTreeIter iter; + gtk_list_store_append (liststore, &iter); + gtk_list_store_set(liststore, &iter, + MODEL_COL_ID, connection_id, + MODEL_COL_NAME, connection_name, + MODEL_COL_SERVER_ACCOUNT_NAME, server_account_name, + -1); + g_free (server_account_name); + } } iter = g_slist_next (iter);