w3c / vc-data-model-2.0-test-suite

W3C Verifiable Credentials v2.0 test suite
https://w3c.github.io/vc-data-model-2.0-test-suite/
Other
11 stars 12 forks source link

Use ?. check on result.errors to prevent test from throwing #33

Closed aljones15 closed 1 year ago

aljones15 commented 1 year ago

the problem:

result.errors.length

If result is undefined this throws (this is rarely the case), but when result.errors is undefined this throws which is often the case. This results in invalid test results where a call on verify will fail because result.errors is not defined.