Skip to content

Commit

Permalink
isCommandRejected: do not go to revisionStore if evtPayload.reason.ag…
Browse files Browse the repository at this point in the history
…gregateId is not defined
  • Loading branch information
adrai committed Mar 22, 2019
1 parent c85961d commit 96ef47d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/denormalizer.js
Expand Up @@ -467,7 +467,7 @@ _.extend(Denormalizer.prototype, {
context: !!this.definitions.event.context ? dotty.get(evt, this.definitions.event.context) : undefined
};

if (!this.definitions.event.revision || !dotty.exists(evt, this.definitions.event.revision)) {
if (!this.definitions.event.revision || !dotty.exists(evt, this.definitions.event.revision) || !evtPayload.reason.aggregateId || (typeof evtPayload.reason.aggregateId !== 'string' && typeof evtPayload.reason.aggregateId !== 'number')) {
this.onEventMissingHandle(info, evt);
if (callback) {
callback(null, evt, []);
Expand Down
3 changes: 3 additions & 0 deletions releasenotes.md
@@ -1,3 +1,6 @@
## [v1.16.52](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.16.51...v1.16.52)
- isCommandRejected: do not go to revisionStore if evtPayload.reason.aggregateId is not defined

## [v1.16.51](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.16.5...v1.16.51)
- update viewmodel

Expand Down

0 comments on commit 96ef47d

Please sign in to comment.