瀏覽代碼

SEC-400: Clarify exception if getter returns null.

Ben Alex 19 年之前
父節點
當前提交
e79a28875f
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      core/src/main/java/org/acegisecurity/acls/objectidentity/ObjectIdentityImpl.java

+ 1 - 0
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;
     }