From 9836c7e10440364f3516c9a29e351cba92237b61 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 29 Jun 2018 07:43:21 +0200 Subject: WebRTC: Nullcheck DataChannel SendPacket calls. --- netwerk/sctp/datachannel/DataChannel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'netwerk/sctp/datachannel/DataChannel.cpp') diff --git a/netwerk/sctp/datachannel/DataChannel.cpp b/netwerk/sctp/datachannel/DataChannel.cpp index d47a9d5ea..f2a91c589 100644 --- a/netwerk/sctp/datachannel/DataChannel.cpp +++ b/netwerk/sctp/datachannel/DataChannel.cpp @@ -654,7 +654,10 @@ int DataChannelConnection::SendPacket(unsigned char data[], size_t len, bool release) { //LOG(("%p: SCTP/DTLS sent %ld bytes", this, len)); - int res = mTransportFlow->SendPacket(data, len) < 0 ? 1 : 0; + int res = 0; + if (mTransportFlow) { + res = mTransportFlow->SendPacket(data, len) < 0 ? 1 : 0; + } if (release) delete [] data; return res; -- cgit v1.2.3