Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
Co-Authored-By: Wes <[email protected]>
  • Loading branch information
mistermoe and wesbillman committed Jan 11, 2024
1 parent fa5dbae commit 0c9dda6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/web5/lib/src/dids/data_models/did_document.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:collection/collection.dart';
import 'package:web5/src/dids/data_models/service.dart';
import 'package:web5/src/dids/data_models/did_resource.dart';
import 'package:web5/src/dids/data_models/verification_method.dart';
Expand Down Expand Up @@ -142,14 +143,14 @@ class DidDocument implements DidResource {
}
}

DidResource? resource =
verificationMethod?.firstWhere((vm) => idVariations.contains(vm.id));
DidResource? resource = verificationMethod
?.firstWhereOrNull((vm) => idVariations.contains(vm.id));

if (resource != null) {
return resource;
}

resource = service?.firstWhere((vm) => idVariations.contains(vm.id));
resource = service?.firstWhereOrNull((vm) => idVariations.contains(vm.id));

return resource;
}
Expand Down

0 comments on commit 0c9dda6

Please sign in to comment.