[telepathy-gabble/master] conn-avatars.c: More assertions on avatar sha1

Alban Crequy alban.crequy at collabora.co.uk
Thu Oct 8 03:32:04 PDT 2009


---
 src/conn-avatars.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/conn-avatars.c b/src/conn-avatars.c
index 557d082..367ef51 100644
--- a/src/conn-avatars.c
+++ b/src/conn-avatars.c
@@ -51,6 +51,9 @@ update_own_avatar_sha1 (GabbleConnection *conn,
   TpBaseConnection *base = (TpBaseConnection *) conn;
   GError *error = NULL;
 
+  /* sha1 can be "" if we know there is no avatar, but must not be NULL here */
+  g_assert (sha1 != NULL);
+
   if (!tp_strdiff (sha1, conn->self_presence->avatar_sha1))
     return TRUE;
 
@@ -83,6 +86,9 @@ connection_avatar_update_cb (GabblePresenceCache *cache,
   GabbleConnection *conn = GABBLE_CONNECTION (user_data);
   TpBaseConnection *base = (TpBaseConnection *) conn;
 
+  /* sha1 can be "" if we know there is no avatar, but must not be NULL here */
+  g_assert (sha1 != NULL);
+
   if (handle == base->self_handle)
     update_own_avatar_sha1 (conn, sha1, NULL);
   else
@@ -99,6 +105,9 @@ connection_got_self_initial_avatar_cb (GObject *obj,
 {
   GabbleConnection *conn = GABBLE_CONNECTION (user_data);
 
+  /* sha1 can be "" if we know there is no avatar, but must not be NULL here */
+  g_assert (sha1 != NULL);
+
   update_own_avatar_sha1 (conn, sha1, NULL);
 }
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list