changeset 29609:1eb68d854dfc

Fix two assertions related to no sessions being created for the media object.
author maiku@pidgin.im
date Mon, 02 Nov 2009 23:14:33 +0000
parents 7c87e62790a6
children e4884dbf0c02
files libpurple/media/media.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media/media.c	Mon Nov 02 20:20:21 2009 +0000
+++ b/libpurple/media/media.c	Mon Nov 02 23:14:33 2009 +0000
@@ -739,7 +739,8 @@
 	}
 
 	/* Free the conference if no sessions left */
-	if (g_hash_table_size(media->priv->sessions) == 0) {
+	if (media->priv->sessions != NULL &&
+			g_hash_table_size(media->priv->sessions) == 0) {
 		g_signal_emit(media, purple_media_signals[STATE_CHANGED],
 				0, PURPLE_MEDIA_STATE_END,
 				NULL, NULL);
@@ -846,9 +847,12 @@
 			/* Everything that needs to be emitted has been */
 		} else if (session_id == NULL && participant == NULL) {
 			/* Emit for everything in the conference */
-			GList *sessions = g_hash_table_get_values(
+			GList *sessions = NULL;
+			GList *participants = media->priv->participants;
+
+			if (media->priv->sessions != NULL)
+				sessions = g_hash_table_get_values(
 					media->priv->sessions);
-			GList *participants = media->priv->participants;
 
 			/* Emit for sessions */
 			for (; sessions; sessions = g_list_delete_link(