better checks on receiveOffer (#11)

This commit is contained in:
Serene Han 2016-03-15 20:13:39 -07:00
parent b1e76420bd
commit 490b8b33b7
3 changed files with 30 additions and 25 deletions

View file

@ -51,7 +51,9 @@ class ProxyPair
@client = channel
receiveWebRTCOffer: (offer) ->
console.assert 'offer' == offer.type
if 'offer' != offer.type
log 'Invalid SDP received -- was not an offer.'
return false
try
err = @pc.setRemoteDescription offer
catch e