From d339104e8f90a7f8a2a2a25d72f2ce012e746797 Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger Date: Tue, 21 May 2024 13:55:01 +0200 Subject: [PATCH] fix: avoid NPE in credential resolver --- .../edc/identityhub/query/CredentialQueryResolverImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/lib/credential-query-lib/src/main/java/org/eclipse/edc/identityhub/query/CredentialQueryResolverImpl.java b/core/lib/credential-query-lib/src/main/java/org/eclipse/edc/identityhub/query/CredentialQueryResolverImpl.java index b8aca9d6b..5ac1b7ee8 100644 --- a/core/lib/credential-query-lib/src/main/java/org/eclipse/edc/identityhub/query/CredentialQueryResolverImpl.java +++ b/core/lib/credential-query-lib/src/main/java/org/eclipse/edc/identityhub/query/CredentialQueryResolverImpl.java @@ -112,7 +112,8 @@ private boolean filterInvalidCredentials(VerifiableCredentialResource verifiable monitor.warning("Credential '%s' is expired.".formatted(credential.getId())); return false; } - var revocationResult = credential.getCredentialStatus().isEmpty() ? Result.success() : revocationService.checkValidity(credential); + var credentialStatus = credential.getCredentialStatus(); + var revocationResult = (credentialStatus == null || credentialStatus.isEmpty()) ? Result.success() : revocationService.checkValidity(credential); if (revocationResult.failed()) { monitor.warning("Credential '%s' not valid: %s".formatted(credential.getId(), revocationResult.getFailureDetail())); return false;