Skip to content

Commit

Permalink
fix: added a guard to check the issuerBranding
Browse files Browse the repository at this point in the history
  • Loading branch information
sksadjad committed Jun 28, 2024
1 parent 17aa278 commit c6d8de2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/oid4vci-holder/src/agent/OID4VCIHolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
IBasicIssuerLocaleBranding,
Identity,
IdentityOrigin,
IIssuerBranding,
NonPersistedIdentity,
Party,
} from '@sphereon/ssi-sdk.data-store'
Expand Down Expand Up @@ -522,7 +523,10 @@ export class OID4VCIHolder implements IAgentPlugin {
.filter((identity) => identity.roles.includes(CredentialRole.ISSUER))
.map((identity) => identity.identifier.correlationId)[0] ?? undefined
if (issuerBrandings && issuerBrandings.length) {
await context.agent.ibAddIssuerBranding({ localeBranding: issuerBrandings, issuerCorrelationId })
const brandings: IIssuerBranding[] = await context.agent.ibGetIssuerBranding({filter:[{issuerCorrelationId}]})
if (!brandings || !brandings.length) {
await context.agent.ibAddIssuerBranding({ localeBranding: issuerBrandings, issuerCorrelationId })
}
}
}
}
Expand Down

0 comments on commit c6d8de2

Please sign in to comment.