Handle claims without matches

This commit is contained in:
Yarmo Mackenbach 2021-06-03 15:03:54 +02:00
parent 0e6c0574b9
commit 12df5b3fc3
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1

View file

@ -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]