From 94cb80c12ce8f5acf170205794bf5d9a4e3944c0 Mon Sep 17 00:00:00 2001 From: makc Date: Fri, 16 Dec 2016 10:43:13 +0100 Subject: [PATCH] fixes #10380 --- examples/js/loaders/PLYLoader.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/js/loaders/PLYLoader.js b/examples/js/loaders/PLYLoader.js index 722dbaa732..f7b4130eae 100644 --- a/examples/js/loaders/PLYLoader.js +++ b/examples/js/loaders/PLYLoader.js @@ -312,7 +312,9 @@ THREE.PLYLoader.prototype = { // mandatory buffer data - geometry.setIndex( new ( buffer.indices.length > 65535 ? THREE.Uint32BufferAttribute : THREE.Uint16BufferAttribute )( buffer.indices, 1 ) ); + if ( buffer.indices.length > 0 ) { + geometry.setIndex( new ( buffer.indices.length > 65535 ? THREE.Uint32BufferAttribute : THREE.Uint16BufferAttribute )( buffer.indices, 1 ) ); + } geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( buffer.vertices, 3 ) ); // optional buffer data -- GitLab