[gnome-contacts] Don't assume Tpf.Personas always contain a TpContact.
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Don't assume Tpf.Personas always contain a TpContact.
- Date: Wed, 29 Jun 2011 07:25:22 +0000 (UTC)
commit 39b99352e7c29395bb3b6512b7b1ea7f4c83f9e1
Author: Travis Reitter <treitter gmail com>
Date: Mon Jun 27 21:15:44 2011 -0700
Don't assume Tpf.Personas always contain a TpContact.
Since Folks added a cache, Tpf.Personas aren't guaranteed to contain a
TpContact.
Helps: bgo#653602 - Gnome Contacts shouldn't assume TpfPersonas contain
valid TpContacts
src/contacts-contact.vala | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala
index 30630bd..27cb8f9 100644
--- a/src/contacts-contact.vala
+++ b/src/contacts-contact.vala
@@ -139,14 +139,14 @@ public class Contacts.Contact : GLib.Object {
p.notify["presence-type"].connect (persona_notify_cb);
p.notify["presence-message"].connect (persona_notify_cb);
var tp = p as Tpf.Persona;
- if (tp != null)
+ if (tp != null && tp.contact != null)
tp.contact.notify["client-types"].connect (persona_notify_cb);
}
private void disconnect_persona (Persona p) {
SignalHandler.disconnect_by_func (individual, (void *)persona_notify_cb, this);
var tp = p as Tpf.Persona;
- if (tp != null)
+ if (tp != null && tp.contact != null)
SignalHandler.disconnect_by_func (tp.contact, (void *)persona_notify_cb, this);
}
@@ -475,7 +475,7 @@ public class Contacts.Contact : GLib.Object {
private static bool get_is_phone (Persona persona) {
var tp = persona as Tpf.Persona;
- if (tp == null)
+ if (tp == null || tp.contact == null)
return false;
var types = tp.contact.get_client_types ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]