From 40ea681bc8189081a784600522977d17e48a8486 Mon Sep 17 00:00:00 2001 From: 06wj <06wj@163.com> Date: Fri, 31 Jul 2020 14:15:38 +0800 Subject: [PATCH] fix: vao.getResources miss checking whether the attribute is empty --- src/renderer/VertexArrayObject.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/renderer/VertexArrayObject.js b/src/renderer/VertexArrayObject.js index c73c80f0..3e1cd824 100644 --- a/src/renderer/VertexArrayObject.js +++ b/src/renderer/VertexArrayObject.js @@ -382,9 +382,11 @@ const VertexArrayObject = Class.create(/** @lends VertexArrayObject.prototype */ * @return {Object[]} */ getResources(resources = []) { - this.attributes.forEach((attributeObject) => { - resources.push(attributeObject.buffer); - }); + if (this.attributes) { + this.attributes.forEach((attributeObject) => { + resources.push(attributeObject.buffer); + }); + } if (this.indexBuffer) { resources.push(this.indexBuffer);