Commit 79f79837 authored by Guillaume Desmottes's avatar Guillaume Desmottes
Browse files

tpf-persona: ignore empty email or phone number

The interface implementation raises an error if we pass it an empty value.

https://bugzilla.gnome.org/show_bug.cgi?id=675144
parent bdc430c7
...@@ -791,9 +791,12 @@ public class Tpf.Persona : Folks.Persona, ...@@ -791,9 +791,12 @@ public class Tpf.Persona : Folks.Persona,
{ {
foreach (var email_addr in info.field_value) foreach (var email_addr in info.field_value)
{ {
var parameters = this._afd_params_from_strv (info.parameters); if (email_addr != "")
var email_fd = new EmailFieldDetails (email_addr, parameters); {
new_email_addresses.add (email_fd); var parameters = this._afd_params_from_strv (info.parameters);
var email_fd = new EmailFieldDetails (email_addr, parameters);
new_email_addresses.add (email_fd);
}
} }
} }
else if (info.field_name == "fn") else if (info.field_name == "fn")
...@@ -806,18 +809,24 @@ public class Tpf.Persona : Folks.Persona, ...@@ -806,18 +809,24 @@ public class Tpf.Persona : Folks.Persona,
{ {
foreach (var phone_num in info.field_value) foreach (var phone_num in info.field_value)
{ {
var parameters = this._afd_params_from_strv (info.parameters); if (phone_num != "")
var phone_fd = new PhoneFieldDetails (phone_num, parameters); {
new_phone_numbers.add (phone_fd); var parameters = this._afd_params_from_strv (info.parameters);
var phone_fd = new PhoneFieldDetails (phone_num, parameters);
new_phone_numbers.add (phone_fd);
}
} }
} }
else if (info.field_name == "url") else if (info.field_name == "url")
{ {
foreach (var url in info.field_value) foreach (var url in info.field_value)
{ {
var parameters = this._afd_params_from_strv (info.parameters); if (url != "")
var url_fd = new UrlFieldDetails (url, parameters); {
new_urls.add (url_fd); var parameters = this._afd_params_from_strv (info.parameters);
var url_fd = new UrlFieldDetails (url, parameters);
new_urls.add (url_fd);
}
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment