summaryrefslogtreecommitdiff
path: root/gnome-unstable/folks/Bug_658631_crash_at_empathy_startup.patch
blob: 6ba35bc02ab2754b428b6e904a903d4f7469e2ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From 1f85f89051e63b05e271b418687c242a83e2f296 Mon Sep 17 00:00:00 2001
From: Philip Withnall <philip@tecnocode.co.uk>
Date: Mon, 12 Sep 2011 22:09:10 +0000
Subject: 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
---
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;
+            }
         }
     }
 
--
cgit v0.9.0.2