Skip to content

Commit

Permalink
chore: add validation
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverlaz committed Dec 19, 2024
1 parent dd24426 commit 9ca17d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/client/src/rtc/Publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ export class Publisher extends BasePeerConnection {
throw new Error(`Can't publish a track that has ended already.`);
}

if (!this.publishOptions.some((o) => o.trackType === trackType)) {
throw new Error(`No publish options found for ${TrackType[trackType]}`);
}

// enable the track if it is disabled
if (!track.enabled) track.enabled = true;

Expand Down

0 comments on commit 9ca17d7

Please sign in to comment.