Skip to content

Commit

Permalink
fix: handle underlying track being undefined in addTransceiver (webex#35
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bbaldino authored and GitHub Enterprise committed Sep 1, 2021
1 parent 2058263 commit b9bbca6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/peer-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class PeerConnection extends EventEmitter {
): RTCRtpTransceiver {
const rtcTrackOrKind =
trackOrKind instanceof LocalTrack ? trackOrKind.getUnderlyingTrack() : trackOrKind;
if (!rtcTrackOrKind) {
throw new Error('Tried to add track with undefined underlying track');
}
return this.pc.addTransceiver(rtcTrackOrKind, init);
}

Expand Down

0 comments on commit b9bbca6

Please sign in to comment.