From 1cabc5e3c422385451b842716b059e73b5dfd197 Mon Sep 17 00:00:00 2001 From: Dimasik Kolezhniuk Date: Tue, 18 Jul 2023 18:08:31 +0200 Subject: [PATCH] fix node_aux --- src/credentials/status/sparse-merkle-tree.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/credentials/status/sparse-merkle-tree.ts b/src/credentials/status/sparse-merkle-tree.ts index 8bd8ca62..473c4cc2 100644 --- a/src/credentials/status/sparse-merkle-tree.ts +++ b/src/credentials/status/sparse-merkle-tree.ts @@ -43,11 +43,12 @@ export class RevocationStatusDTO { toRevocationStatus(): RevocationStatus { const p = new Proof(); p.existence = this.mtp.existence; - p.nodeAux = { - key: newHashFromBigInt(BigInt(this.mtp.node_aux.key)), - value: newHashFromBigInt(BigInt(this.mtp.node_aux.value)) - }; - + if (this.mtp.node_aux) { + p.nodeAux = { + key: newHashFromBigInt(BigInt(this.mtp.node_aux.key)), + value: newHashFromBigInt(BigInt(this.mtp.node_aux.value)) + }; + } const s = this.mtp.siblings.map((s) => newHashFromBigInt(BigInt(s))); p.siblings = [];