diff --git a/src/structs/Item.js b/src/structs/Item.js index 7e1bc92c..c14778b3 100644 --- a/src/structs/Item.js +++ b/src/structs/Item.js @@ -389,9 +389,8 @@ export class Item extends AbstractStruct { } if ((this.left && this.left.constructor === GC) || (this.right && this.right.constructor === GC)) { this.parent = null - } - // only set parent if this shouldn't be garbage collected - if (!this.parent) { + } else if (!this.parent) { + // only set parent if this shouldn't be garbage collected if (this.left && this.left.constructor === Item) { this.parent = this.left.parent this.parentSub = this.left.parentSub