diff --git a/server/module-elements/src/gst-plugins/rtpendpoint/kmsrtpendpoint.c b/server/module-elements/src/gst-plugins/rtpendpoint/kmsrtpendpoint.c index a3db2b8db..b4dd4e6e8 100644 --- a/server/module-elements/src/gst-plugins/rtpendpoint/kmsrtpendpoint.c +++ b/server/module-elements/src/gst-plugins/rtpendpoint/kmsrtpendpoint.c @@ -301,11 +301,15 @@ kms_rtp_endpoint_get_connection (KmsRtpEndpoint * self, KmsSdpSession * sess, conn = kms_srtp_session_get_connection (KMS_SRTP_SESSION (sess), handler); - data = sdes_ext_data_new (self, gst_sdp_media_get_media (media)); + if (conn == NULL) { + GST_INFO_OBJECT (self, "No connection for media %s", (const gchar*)media->media); + } else { + data = sdes_ext_data_new (self, gst_sdp_media_get_media (media)); - g_signal_connect_data (conn, "key-soft-limit", - G_CALLBACK (conn_soft_limit_cb), data, - (GClosureNotify) kms_ref_struct_unref, 0); + g_signal_connect_data (conn, "key-soft-limit", + G_CALLBACK (conn_soft_limit_cb), data, + (GClosureNotify) kms_ref_struct_unref, 0); + } return conn; } else { return kms_rtp_session_get_connection (KMS_RTP_SESSION (sess), handler);