diff --git a/internal/command/unique_constraints_model.go b/internal/command/unique_constraints_model.go index 8fffde15fe..64b83100c2 100644 --- a/internal/command/unique_constraints_model.go +++ b/internal/command/unique_constraints_model.go @@ -52,7 +52,7 @@ func (rm *UniqueConstraintReadModel) Reduce() error { case *iam.IDPConfigAddedEvent: rm.addUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner)) case *iam.IDPConfigChangedEvent: - if e.Name != nil { + if e.Name == nil { continue } rm.changeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner)) @@ -61,7 +61,7 @@ func (rm *UniqueConstraintReadModel) Reduce() error { case *org.IDPConfigAddedEvent: rm.addUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner)) case *org.IDPConfigChangedEvent: - if e.Name != nil { + if e.Name == nil { continue } rm.changeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner)) @@ -76,7 +76,7 @@ func (rm *UniqueConstraintReadModel) Reduce() error { case *project.ProjectAddedEvent: rm.addUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.NewAddProjectNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner)) case *project.ProjectChangeEvent: - if e.Name != nil { + if e.Name == nil { continue } rm.changeUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.NewAddProjectNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner))