Skip to content

Commit

Permalink
fix: make BearerDid null-safe (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-tbd authored Apr 26, 2024
1 parent d5d380d commit d52205e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/web5/lib/src/dids/bearer_did.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ class BearerDid {
}

final keyExporter = keyManager as KeyExporter;
for (final vm in document.verificationMethod!) {
final publicKeyJwk = vm.publicKeyJwk!;
for (final vm in document.verificationMethod ?? []) {
if (vm.publicKeyJwk == null) {
continue;
}

final publicKeyJwk = vm.publicKeyJwk;
final keyId = publicKeyJwk.computeThumbprint();
final jwk = await keyExporter.export(keyId);

Expand Down

0 comments on commit d52205e

Please sign in to comment.