Skip to content

Commit

Permalink
fix: decrypt only if encrypted payload exists
Browse files Browse the repository at this point in the history
  • Loading branch information
sgomez committed Jul 25, 2021
1 parent c1c5e3f commit 0aed374
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/eventstore.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class EventStoreMapper {
resolvedEvent: ResolvedEvent,
): Promise<JSONType | Uint8Array> {
const metadata = resolvedEvent.event.metadata as Metadata;
return metadata._aggregate_encrypted
return metadata._encrypted_payload
? await this.keyService.decryptPayload(
metadata._aggregate_id,
metadata._encrypted_payload,
Expand Down

0 comments on commit 0aed374

Please sign in to comment.