diff --git a/domain/src/main/java/org/acegisecurity/domain/dao/EvictionUtils.java b/domain/src/main/java/org/acegisecurity/domain/dao/EvictionUtils.java index 277dd574d9..68f78afb53 100644 --- a/domain/src/main/java/org/acegisecurity/domain/dao/EvictionUtils.java +++ b/domain/src/main/java/org/acegisecurity/domain/dao/EvictionUtils.java @@ -40,15 +40,13 @@ public class EvictionUtils { * * @param daoOrServices the potential source for * EvictionCapable services (never null) - * @param entity to evict (never null) + * @param entity to evict (can be null) */ public static void evictIfRequired(Object daoOrServices, PersistableEntity entity) { - Assert.notNull(entity, "Cannot evict an empty PersistableEntity object!"); - EvictionCapable evictor = getEvictionCapable(daoOrServices); - if (evictor != null) { + if (evictor != null && entity != null) { evictor.evict(entity); } }