summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2023-04-07 00:49:29 -0500
committerGary Kramlich <grim@reaperworld.com>2023-04-07 00:49:29 -0500
commita7d28aa53a772a950f79d189310b32a3a765c007 (patch)
tree87b40ce44a01808472676f7cc1b9830577d1ee28
parentbee99bb8f844575c7fdb938f998f859ee03fa23a (diff)
downloadpidgin-a7d28aa53a772a950f79d189310b32a3a765c007.tar.gz
Fix some issues where we were triggering GWarnings with presence
Testing Done: I ran into these while porting the Bonjour prpl to the new status API, so I verified they stopped happening against that code. Reviewed at https://reviews.imfreedom.org/r/2426/
-rw-r--r--libpurple/purplepresence.c4
-rw-r--r--pidgin/pidgincontactlist.c7
2 files changed, 9 insertions, 2 deletions
diff --git a/libpurple/purplepresence.c b/libpurple/purplepresence.c
index 0182e54760..5095ddf28a 100644
--- a/libpurple/purplepresence.c
+++ b/libpurple/purplepresence.c
@@ -653,6 +653,10 @@ purple_presence_get_message(PurplePresence *presence) {
return priv->message;
}
+ if(priv->active_status == NULL) {
+ return NULL;
+ }
+
return purple_status_get_attr_string(priv->active_status, "message");
}
diff --git a/pidgin/pidgincontactlist.c b/pidgin/pidgincontactlist.c
index fd09bbe6a4..394d3afc65 100644
--- a/pidgin/pidgincontactlist.c
+++ b/pidgin/pidgincontactlist.c
@@ -84,13 +84,16 @@ pidgin_contact_list_avatar_cb(G_GNUC_UNUSED GObject *self,
return NULL;
}
+ info = purple_person_get_priority_contact_info(person);
+ if(!PURPLE_IS_CONTACT_INFO(info)) {
+ return NULL;
+ }
+
pixbuf = purple_person_get_avatar_for_display(person);
if(GDK_IS_PIXBUF(pixbuf)) {
return gdk_texture_new_for_pixbuf(pixbuf);
}
- info = purple_person_get_priority_contact_info(person);
-
/* All of the contact info in the manager are PurpleContact's so this cast
* is fine.
*/