Skip to content

Commit

Permalink
RingBuffer: Default to 0 if arraySequence[0] is undefined (#542)
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Kayson <[email protected]>
  • Loading branch information
MrRoboman and Robert Kayson authored Aug 24, 2020
1 parent 91d8b34 commit 6c54c28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/audioWorklet/ringBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class RingBuffer {
// match with this buffer obejct.

// Transfer data from the |arraySequence| storage to the internal buffer.
let sourceLength = arraySequence[0].length;
let sourceLength = arraySequence[0] ? arraySequence[0].length : 0;
for (let i = 0; i < sourceLength; ++i) {
let writeIndex = (this._writeIndex + i) % this._length;
for (let channel = 0; channel < this._channelCount; ++channel) {
Expand Down

0 comments on commit 6c54c28

Please sign in to comment.