Skip to content

Commit

Permalink
chore: Added a check for a undefined schema
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Lanser <[email protected]>
  • Loading branch information
Tommylans committed Sep 15, 2023
1 parent ab2e79a commit d9528f3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,11 @@ export class CheqdAnonCredsRegistry implements AnonCredsRegistry {
const cheqdDidRegistrar = agentContext.dependencyManager.resolve(CheqdDidRegistrar)
const { credentialDefinition } = options
const schema = await this.getSchema(agentContext, credentialDefinition.schemaId)
if (!schema.schema) {
throw new Error(`Schema not found for schemaId: ${credentialDefinition.schemaId}`)
}

const credDefName = `${schema.schema?.name}-${credentialDefinition.tag}`
const credDefName = `${schema.schema.name}-${credentialDefinition.tag}`
const credDefNameHashBuffer = Hasher.hash(Buffer.from(credDefName), 'sha2-256')

const credDefResource = {
Expand Down

0 comments on commit d9528f3

Please sign in to comment.