Ensure NameDetails public strings are non-null as we promise.
authorTravis Reitter <travis.reitter@collabora.co.uk>
Mon, 14 Nov 2011 22:29:21 +0000 (14:29 -0800)
committerTravis Reitter <travis.reitter@collabora.co.uk>
Fri, 25 Nov 2011 17:42:15 +0000 (09:42 -0800)
Closes: bug#663889 - crash due to NameDetails which fail to guarantee
non-null full-name/nickname

NEWS
backends/eds/lib/edsf-persona.vala
backends/telepathy/lib/tpf-persona.vala
backends/tracker/lib/trf-persona.vala

diff --git a/NEWS b/NEWS
index f2754c1..9805051 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ Overview of changes from libfolks 0.6.5 to libfolks 0.6.6
 Bugs fixed:
 * Bug 664158 — Stale log handler can cause segfault when re-creating Aggregator
   in a single run
+* Bug 663889 — crash due to NameDetails which fail to guarantee
+  non-null full-name/nickname
 
 Overview of changes from libfolks 0.6.4.1 to libfolks 0.6.5
 =============================================================
index c73b77b..17a31f3 100644 (file)
@@ -700,6 +700,8 @@ public class Edsf.Persona : Folks.Persona,
       var full_name =
           (string) Edsf.Persona._get_property_from_contact (contact,
               "full_name");
+      if (full_name == null)
+        full_name = "";
 
       debug ("Creating new Edsf.Persona with IID '%s'", iid);
 
index 2a626c9..b25ee32 100644 (file)
@@ -752,6 +752,8 @@ public class Tpf.Persona : Folks.Persona,
           else if (info.field_name == "fn")
             {
               new_full_name = info.field_value[0];
+              if (new_full_name == null)
+                new_full_name = "";
             }
           else if (info.field_name == "tel")
             {
index 636bbe3..45c674a 100644 (file)
@@ -1102,6 +1102,8 @@ public class Trf.Persona : Folks.Persona,
           var proto = addr_info[Trf.IMFields.PROTO];
           var account_id = addr_info[Trf.IMFields.ID];
           var nickname = addr_info[Trf.IMFields.IM_NICKNAME];
+          if (nickname == null)
+            nickname = "";
 
           this._update_nickname (nickname);
           this._add_im_address (tracker_id, proto, account_id, false);