Skip to content

Commit

Permalink
Account for case where proof is non-existent hence has no id.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Sep 4, 2024
1 parent 42fd29d commit defe80a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/DataIntegrityProof.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export class DataIntegrityProof extends LinkedDataProof {
const previousProofs = Array.isArray(proof.previousProof) ?
proof.previousProof : [proof.previousProof];
if(!previousProofs.every(proofId =>
proofSet.some(proof => proof.id === proofId))) {
proofSet.some(proof => proof?.id === proofId))) {
throw new Error(
`Unable to find previousProof ${proof.previousProof}`);
}
Expand Down

0 comments on commit defe80a

Please sign in to comment.