Skip to content

Commit

Permalink
fix: vao.getResources miss checking whether the attribute is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
06wj committed Jul 31, 2020
1 parent fea3cdf commit 40ea681
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/renderer/VertexArrayObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 40ea681

Please sign in to comment.