changeset 26210:20c16e29f364

Stop crash when there are no candidates set.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Wed, 25 Feb 2009 09:20:20 +0000
parents df133a5df391
children 7acca8d51421
files libpurple/protocols/jabber/jingle/iceudp.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jingle/iceudp.c	Wed Feb 25 08:18:17 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/iceudp.c	Wed Feb 25 09:20:20 2009 +0000
@@ -334,10 +334,14 @@
 
 	if (action == JINGLE_SESSION_INITIATE || action == JINGLE_TRANSPORT_INFO ||
 			action == JINGLE_CONTENT_ADD || action == JINGLE_TRANSPORT_REPLACE) {
-		JingleIceUdpCandidate *candidate = JINGLE_ICEUDP_GET_PRIVATE(
-				transport)->local_candidates->data;
-		xmlnode_set_attrib(node, "pwd", candidate->password);
-		xmlnode_set_attrib(node, "ufrag", candidate->username);
+		JingleIceUdpPrivate *icetransport =
+				JINGLE_ICEUDP_GET_PRIVATE(transport);
+		if (icetransport && icetransport->local_candidates) {
+			JingleIceUdpCandidate *candidate =
+					icetransport->local_candidates->data;
+			xmlnode_set_attrib(node, "pwd", candidate->password);
+			xmlnode_set_attrib(node, "ufrag", candidate->username);
+		}
 	}
 
 	if (action == JINGLE_TRANSPORT_INFO || action == JINGLE_SESSION_ACCEPT) {