From b0d1523606bac56f3f0d3b828757a7c11b63e506 Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Mon, 1 Jul 2024 12:47:08 -0400 Subject: [PATCH] Fix check for empty child references [no ci] --- packages/verkle/src/node/internalNode.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/verkle/src/node/internalNode.ts b/packages/verkle/src/node/internalNode.ts index bcc2ea323f..511ba4c9c8 100644 --- a/packages/verkle/src/node/internalNode.ts +++ b/packages/verkle/src/node/internalNode.ts @@ -18,7 +18,8 @@ export class InternalNode extends BaseVerkleNode { // Updates the commitment value for a child node at the corresponding index setChild(childIndex: number, child: ChildNode) { // Get previous child commitment at `index` - const oldChildReference = this.children[childIndex] ?? EMPTY_CHILD + const oldChildReference = + this.children[childIndex] !== null ? this.children[childIndex] : EMPTY_CHILD // Updates the commitment to the child node at `index` this.children[childIndex] = { ...child } // Updates the overall node commitment based on the update to this child