Skip to content

Commit

Permalink
fix(ddd): fix entiry query
Browse files Browse the repository at this point in the history
  • Loading branch information
lujinghao committed Mar 12, 2024
1 parent 09c7cbb commit 897aa4b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,13 +662,13 @@ func (e *Stage) BuildEntity(ctx context.Context, parent IEntity, children ...int
if itemVal.Elem().IsNil() && itemVal.Elem().CanSet() {
newItem := reflect.New(itemType.Elem().Elem())
itemVal.Elem().Set(newItem)
itemValDef := newItem.Interface()
if err := e.buildEntity(ctx, itemValDef.(IEntity), parent); err != nil {
if errors.Is(err, ErrEntityNotFound) {
itemVal.Elem().SetZero()
} else {
return err
}
}
itemDef := itemVal.Elem().Interface()
if err := e.buildEntity(ctx, itemDef.(IEntity), parent); err != nil {
if errors.Is(err, ErrEntityNotFound) {
itemVal.Elem().SetZero()
} else {
return err
}
}
} else if itemType.Implements(entityType) {
Expand Down

0 comments on commit 897aa4b

Please sign in to comment.