Skip to content

Commit

Permalink
FIX do not parse null JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarber committed Jan 3, 2017
1 parent b24af41 commit ae235b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rtcstats.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@
var id = 'PC_' + peerconnectioncounter++;
var pc = new origPeerConnection(config, constraints);

if (!config) {
config = { nullConfig: true };
}

config = JSON.parse(JSON.stringify(config)); // deepcopy
// don't log credentials
(config && config.iceServers || []).forEach(function(server) {
delete server.credential;
});

if (!config) {
config = { nullConfig: true };
}

config.browserType = isChrome ? 'webkit' : 'moz';
if (window.RTCIceGatherer) {
config.browserType = 'edge';
Expand Down

0 comments on commit ae235b5

Please sign in to comment.