=?utf-8?q?=5Bfolks=5D_Bug_658631_=E2=80=94_crash_at_empathy_startup?=



commit 1f85f89051e63b05e271b418687c242a83e2f296
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Sep 12 23:09:10 2011 +0100

    Bug 658631 â crash at empathy startup
    
    In the case that a persona is removed and the individual containing that
    persona is replaced by a different non-null individual which doesn't contain
    that persona (because it's been removed), we need to set the persona's
    individual pointer to null rather than the replacement individual.
    
    This stops us tripping the assertion in the setter for Persona.individual.
    
    Closes: bgo#658631

 NEWS                  |    2 ++
 folks/individual.vala |   14 +++++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index db997bc..63502d8 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 Overview of changes from libfolks 0.6.2.1 to libfolks 0.6.3
 ===========================================================
 
+Bugs fixed:
+* Bug 658631 â crash at empathy startup
 
 Overview of changes from libfolks 0.6.2 to libfolks 0.6.2.1
 ===========================================================
diff --git a/folks/individual.vala b/folks/individual.vala
index 3b6c12b..59548ee 100644
--- a/folks/individual.vala
+++ b/folks/individual.vala
@@ -1510,7 +1510,19 @@ public class Folks.Individual : Object,
        * aggregator's rewritten, it would be nice to fix this. */
       if (persona.individual == this)
         {
-          persona.individual = replacement_individual;
+          /* It may be the case that the persona's being removed from the
+           * individual (i.e. the replacement individual is non-null, but
+           * doesn't contain this persona). In this case, we need to set the
+           * persona's individual to null. */
+          if (replacement_individual != null &&
+              persona in replacement_individual.personas)
+            {
+              persona.individual = replacement_individual;
+            }
+          else
+            {
+              persona.individual = null;
+            }
         }
     }
 



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