From 9694c81384503620023dedc5ffb7feaf1c0aaae5 Mon Sep 17 00:00:00 2001 From: Joel Thorstensson Date: Wed, 10 Mar 2021 10:24:21 +0100 Subject: [PATCH] fix: Remove null check --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 8628e0c2..de2097cb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -218,7 +218,7 @@ export class DID { const kid = base64urlToJSON(jws.split('.')[0]).kid as string if (!kid) throw new Error('No "kid" found in jws') const didResolutionResult = await this.resolve(kid) - const publicKeys = didResolutionResult.didDocument!.verificationMethod || [] + const publicKeys = didResolutionResult.didDocument?.verificationMethod || [] // verifyJWS will throw an error if the signature is invalid verifyJWS(jws, publicKeys) let payload