- if (is_transport_and_not_store) {
- protocol = modest_protocol_registry_get_protocol_by_name (registry, MODEST_PROTOCOL_REGISTRY_TRANSPORT_PROTOCOLS, string);
+ if (string) {
+ gchar *tag = NULL;
+ if (is_transport_and_not_store) {
+ tag = MODEST_PROTOCOL_REGISTRY_TRANSPORT_PROTOCOLS;
+ } else {
+ tag = MODEST_PROTOCOL_REGISTRY_STORE_PROTOCOLS;
+ }
+ protocol = modest_protocol_registry_get_protocol_by_name (registry, tag, string);
+
+ modest_server_account_settings_set_protocol (settings,
+ modest_protocol_get_type_id (protocol));
+ g_free (string);