Skip to content

Commit

Permalink
Remove null contexts.
Browse files Browse the repository at this point in the history
  • Loading branch information
peacekeeper committed Aug 22, 2022
1 parent 87b66f3 commit a82d44f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/uniresolver/driver/did/dns/DidDnsDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

public class DidDnsDriver implements Driver {

Expand Down Expand Up @@ -129,7 +130,7 @@ public ResolveDataModelResult resolve(DID did, Map<String, Object> resolveOption
DIDDocument didKeyDidDocument = this.getClientUniResolver().resolve(target).getDidDocument();
if (log.isDebugEnabled()) log.debug("Resolved " + target + " to " + didKeyDidDocument);

contexts.addAll(didKeyDidDocument.getContexts());
contexts.addAll(didKeyDidDocument.getContexts().stream().filter(Objects::nonNull).collect(Collectors.toList()));
if (log.isDebugEnabled()) log.debug("Contexts now: " + contexts);

List<Object> verificationMethods = JsonLDUtils.jsonLdGetJsonArray(didKeyDidDocument.getJsonObject(), DIDKeywords.JSONLD_TERM_VERIFICATIONMETHOD);
Expand Down

0 comments on commit a82d44f

Please sign in to comment.