Skip to content

Commit

Permalink
fix(TPC): crash on FF accessing LD/RD
Browse files Browse the repository at this point in the history
Firefox return null/undefined for localDescription/remoteDescription
objects if they have not been set yet, while Chrome does return empty
object instead. This commit makes the behaviour consistent by making
sure that at least empty object is returned for all browsers.
  • Loading branch information
paweldomas committed Feb 20, 2017
1 parent c7d68f2 commit 160442c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/RTC/TraceablePeerConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ var getters = {
+ '(local video mute hack)', desc);
}

return desc;
return desc ? desc : {};
},
remoteDescription: function() {
var desc = this.peerconnection.remoteDescription;
Expand All @@ -961,7 +961,7 @@ var getters = {
this.trace(
'getRemoteDescription::postTransform (Plan B)', dumpSDP(desc));
}
return desc;
return desc ? desc : { };
}
};
Object.keys(getters).forEach(function (prop) {
Expand Down

0 comments on commit 160442c

Please sign in to comment.