From 01099495178e2ccf0205c519b6a0a37702bfcd13 Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Sun, 29 Jun 2025 19:11:18 -0400 Subject: [PATCH] Fix errors in ElementsBase. --- lib/elements/ElementsBase.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/elements/ElementsBase.ts b/lib/elements/ElementsBase.ts index 9c2bbc11..46247221 100644 --- a/lib/elements/ElementsBase.ts +++ b/lib/elements/ElementsBase.ts @@ -180,8 +180,8 @@ export class ElementsBase extends AssetBase implements IElements { for (const name in this._customAttributes) { this._customAttributes[name].dispose(); - delete this._customAttributes; } + delete this._customAttributes; } /** @@ -239,10 +239,12 @@ export class ElementsBase extends AssetBase implements IElements { } this._customAttributes[name].set(values, offset); - } else if (this._customAttributes[name]) { - this.clearVertices(this._customAttributes[name]); - this._customAttributesNames.splice(this._customAttributesNames.indexOf(name), 1); - delete this._customAttributes[name]; + } else { + if (this._customAttributes[name]) { + this.clearVertices(this._customAttributes[name]); + this._customAttributesNames.splice(this._customAttributesNames.indexOf(name), 1); + delete this._customAttributes[name]; + } return; }