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
......@@ -790,12 +790,15 @@ public class Tpf.Persona : Folks.Persona,
else if (info.field_name == "email")
{
foreach (var email_addr in info.field_value)
{
if (email_addr != "")
{
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")
{
new_full_name = info.field_value[0];
......@@ -805,15 +808,20 @@ public class Tpf.Persona : Folks.Persona,
else if (info.field_name == "tel")
{
foreach (var phone_num in info.field_value)
{
if (phone_num != "")
{
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")
{
foreach (var url in info.field_value)
{
if (url != "")
{
var parameters = this._afd_params_from_strv (info.parameters);
var url_fd = new UrlFieldDetails (url, parameters);
......@@ -821,6 +829,7 @@ public class Tpf.Persona : Folks.Persona,
}
}
}
}
if (new_birthday_str != "")
{
......
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