[folks] Don't assume Personas all have a corresponding Individual in the link map.



commit 2ea29b01bb2f43866fcdc71ea5af53803caeafe3
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Mon Oct 11 13:28:05 2010 -0700

    Don't assume Personas all have a corresponding Individual in the link map.
    
    This can happen if a Persona is removed (by ID) before its corresponding
    Individual has been added to the linked-personas map (which is possible if a
    Telepathy account suddenly goes offline before the linking of the given Persona
    is complete).
    
    Fixes bgo#631864.

 NEWS                             |    1 +
 folks/individual-aggregator.vala |    9 +++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index 9e9272b..0d9c743 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ Overview of changes from libfolks 0.3.0 to libfolks 0.3.1
 
 Bugs fixed:
 * Bug 630431 â?? notify::alias is never emitted
+* Bug 631864 â?? Crash when empathy disconnects
 * Tpf.Persona.contact is now guaranteed to have the client type feature
 
 Overview of changes from libfolks 0.1.17 to libfolks 0.3.0
diff --git a/folks/individual-aggregator.vala b/folks/individual-aggregator.vala
index 38fad6e..e7b9902 100644
--- a/folks/individual-aggregator.vala
+++ b/folks/individual-aggregator.vala
@@ -523,11 +523,12 @@ public class Folks.IndividualAggregator : Object
            * eliminate them from the list of Personas to relink, below. */
           removed_personas.add (persona);
 
-          /* Find the Individual containing the Persona and mark them for
-           * removal (any other Personas they have which aren't being removed
-           * will be re-linked into other Individuals). */
+          /* Find the Individual containing the Persona (if any) and mark them
+           * for removal (any other Personas they have which aren't being
+           * removed will be re-linked into other Individuals). */
           Individual ind = this.link_map.lookup (persona.iid);
-          removed_individuals.prepend (ind);
+          if (ind != null)
+            removed_individuals.prepend (ind);
           this.link_map.remove (persona.iid);
 
           if (trust_level == PersonaStoreTrust.FULL)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]