Skip to content

Commit 7a6acf3

Browse files
author
Tomaž Žinko
authored
Update aggregate_repository.go
1 parent 5fe9093 commit 7a6acf3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

aggregate_repository.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ func (r *PublisherRepository) Reconstitute(id string, source AggregateRoot, stre
5858
}
5959
events := stream.Events
6060

61+
if len(events) == 0 {
62+
return errors.New("No events found for this id")
63+
}
64+
6165
for _, event := range events {
6266
source.Apply(event.Payload)
6367
}

0 commit comments

Comments
 (0)