Skip to content

Commit

Permalink
Deep clone the options so we do not set the processor to undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
toger5 committed Dec 3, 2024
1 parent ae729b3 commit 2960d8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/room/track/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export function diffAttributes(

/** @internal */
export function extractProcessorsFromOptions(options: CreateLocalTracksOptions) {
const newOptions = { ...options };
const newOptions = cloneDeep(options);
let audioProcessor: TrackProcessor<Track.Kind.Audio, AudioProcessorOptions> | undefined;
let videoProcessor: TrackProcessor<Track.Kind.Video, VideoProcessorOptions> | undefined;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/cloneDeep.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function cloneDeep<T>(value: T) {
if (typeof value === 'undefined') {
return;
return value;
}

if (typeof structuredClone === 'function') {
Expand Down

0 comments on commit 2960d8c

Please sign in to comment.