Skip to content

Commit 6c54c28

Browse files
MrRobomanRobert Kayson
andauthored
RingBuffer: Default to 0 if arraySequence[0] is undefined (#542)
Co-authored-by: Robert Kayson <[email protected]>
1 parent 91d8b34 commit 6c54c28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/audioWorklet/ringBuffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class RingBuffer {
6363
// match with this buffer obejct.
6464

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

0 commit comments

Comments
 (0)