Skip to content

Commit

Permalink
Fix check for empty child references [no ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Jul 1, 2024
1 parent 132c9e4 commit b0d1523
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/verkle/src/node/internalNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export class InternalNode extends BaseVerkleNode<VerkleNodeType.Internal> {
// 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
Expand Down

0 comments on commit b0d1523

Please sign in to comment.