From 47902dd8ac5c75986c6a5b0aa8f33d51fdb96786 Mon Sep 17 00:00:00 2001
From: Anthony Minessale <anthm@freeswitch.org>
Date: Wed, 30 Sep 2015 12:53:47 -0500
Subject: [PATCH] FS-8252 #resolve [Crash in rtp stack on dtls pointer]

---
 src/switch_rtp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/switch_rtp.c b/src/switch_rtp.c
index bc3ca09fc9..7573aa16c6 100644
--- a/src/switch_rtp.c
+++ b/src/switch_rtp.c
@@ -1184,7 +1184,7 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d
 				ice->last_ok = now;
 				rtp_session->wrong_addrs = 0;
 			} else {
-				if ((rtp_session->dtls->state != DS_READY || !ice->ready || !ice->rready)) {
+				if (((rtp_session->dtls && rtp_session->dtls->state != DS_READY) || !ice->ready || !ice->rready)) {
 					do_adj++;
 				} else if (rtp_session->wrong_addrs > 5 || elapsed >= 3000) {
 					do_adj++;