Skip to content

Commit fd4c58d

Browse files
committed
BufferGeometry/InterleavedBuffer: Set count to 0 if called with undefined array. See clone().
1 parent 86431a5 commit fd4c58d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/BufferAttribute.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function BufferAttribute( array, itemSize, normalized ) {
2020

2121
this.array = array;
2222
this.itemSize = itemSize;
23-
this.count = array.length / itemSize;
23+
this.count = array !== undefined ? array.length / itemSize : 0;
2424
this.normalized = normalized === true;
2525

2626
this.dynamic = false;

src/core/InterleavedBuffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function InterleavedBuffer( array, stride ) {
1010

1111
this.array = array;
1212
this.stride = stride;
13-
this.count = array.length / stride;
13+
this.count = array !== undefined ? array.length / stride : 0;
1414

1515
this.dynamic = false;
1616
this.updateRange = { offset: 0, count: - 1 };

0 commit comments

Comments
 (0)