From ac7457f53233b87145c655c5022bf023e07f2ea2 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 16 Sep 2015 21:27:21 +0100 Subject: [PATCH] null check --- lib/webrtc/call.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/webrtc/call.js b/lib/webrtc/call.js index 5ec072761..84edace08 100644 --- a/lib/webrtc/call.js +++ b/lib/webrtc/call.js @@ -156,7 +156,11 @@ MatrixCall.prototype._initWithInvite = function(event) { // firefox and OpenWebRTC's RTCPeerConnection doesn't add streams until it // starts getting media on them so we need to figure out whether a video // channel has been offered by ourselves. - if (this.msg.offer.sdp.indexOf('m=video') > -1) { + if ( + this.msg.offer && + this.msg.offer.sdp && + this.msg.offer.sdp.indexOf('m=video') > -1 + ) { this.type = 'video'; } else {