From 12df5b3fc3efafad861e50d661d652f7090926af Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Thu, 3 Jun 2021 15:03:54 +0200 Subject: [PATCH] Handle claims without matches --- src/claim.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/claim.js b/src/claim.js index b563856..645b3dd 100644 --- a/src/claim.js +++ b/src/claim.js @@ -209,6 +209,16 @@ class Claim { // Handle options opts = mergeOptions(defaults.opts, opts ? opts : {}) + // If there are no matches + if (this._matches.length === 0) { + this._verification = { + result: false, + completed: true, + proof: {}, + errors: ['No matches for claim'], + } + } + // For each match for (let index = 0; index < this._matches.length; index++) { const claimData = this._matches[index]