Skip to content

Commit

Permalink
Fix a SOE that would occur when using audit trails with self-referenc…
Browse files Browse the repository at this point in the history
…ing relationships.
  • Loading branch information
fbarthez authored and darkv committed May 30, 2016
1 parent 8a20eaa commit d6b6b8b
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,14 @@ protected Configuration configureEntity(EOEntity entity) {
}
if (rel.isToMany()) {
EOEntity destinationEntity = rel.destinationEntity();
Configuration destinationConfiguration = configureEntity(destinationEntity);
String inverseName = rel.anyInverseRelationship().name();
destinationConfiguration.notificationKeys.addObject(inverseName);
source = rel.destinationEntity();
// skip for self-referencing relationships, i.e. when
// the destination entity has already been configured
if (configuration.objectForKey(destinationEntity.name()) == null) {
Configuration destinationConfiguration = configureEntity(destinationEntity);
String inverseName = rel.anyInverseRelationship().name();
destinationConfiguration.notificationKeys.addObject(inverseName);
source = rel.destinationEntity();
}
} else {
config.keys.addObject(rel.name());
}
Expand Down

0 comments on commit d6b6b8b

Please sign in to comment.