GNOME Bugzilla – Bug 675211
email-details.vala:55: Empty e-mail address passed to EmailFieldDetails
Last modified: 2012-05-03 08:31:15 UTC
I just got this warning with Folks master. I first thought it was a simliar issue as bug #675144 but here the EmailFieldDetails is created in the tpf-persona-store-cache. Is it a side effect of bug #675144 as empty fields have been stored in the cache? We may just have to ignore empty values. (empathy:14995): folks-WARNING **: email-details.vala:55: Empty e-mail address passed to EmailFieldDetails.
+ Trace 230155
Created attachment 213164 [details] [review] persona-store-cache: don't create empty field details
Review of attachment 213164 [details] [review]: ::: backends/telepathy/lib/tpf-persona-store-cache.vala @@ +336,3 @@ { + if (v != null) + email_address_set.add (new EmailFieldDetails (v, p)); Are you sure this works? v should never be null; iirc GVariant guarantees that strings are never null (since we don’t use maybe types). My guess is that you should be checking for “!= ""” here. Also (in any case), please put braces around the if block, even if it’s only one line long. It might also be helpful to add a comment saying that this check is only necessary to deal with broken cache files. :-)
You're right, it should be != "". Do you have an equivalent of tp_str_empty()? Would make things easier.
Created attachment 213260 [details] [review] persona-store-cache: don't create empty field details
Review of attachment 213260 [details] [review]: Looks good to me. Please commit to master. > Do you have an equivalent of tp_str_empty()? Would make things easier. We don’t , and it’s not really relevant here because the values can never be null. I guess a tp_str_empty() equivalent could be added in future if it becomes useful.
Attachment 213260 [details] pushed as 2f1c60b - persona-store-cache: don't create empty field details