diff --git a/core/src/main/java/org/acegisecurity/acls/objectidentity/ObjectIdentityImpl.java b/core/src/main/java/org/acegisecurity/acls/objectidentity/ObjectIdentityImpl.java index fe3a309a24..5098aab5a5 100644 --- a/core/src/main/java/org/acegisecurity/acls/objectidentity/ObjectIdentityImpl.java +++ b/core/src/main/java/org/acegisecurity/acls/objectidentity/ObjectIdentityImpl.java @@ -83,6 +83,7 @@ public class ObjectIdentityImpl implements ObjectIdentity { throw new IdentityUnavailableException("Could not extract identity from object " + object, e); } + Assert.notNull(result, "getId() is required to return a non-null value"); Assert.isInstanceOf(Serializable.class, result, "Getter must provide a return value of type Serializable"); this.identifier = (Serializable) result; }