I am getting a NullPointerException in DirContextAdapter when trying to use LdapTemplate to update an existing ODM object. The exception is in the version of collectModications() that takes a NameAwareAttribute. I am trying to set the "manager" attribute when it was previously null.

Here's the code from DirContextAdapater:

private void collectModifications(NameAwareAttribute changedAttr,
List<ModificationItem> modificationList) throws NamingException {
NameAwareAttribute currentAttribute = originalAttrs.get(changedAttr.getID());
if(changedAttr.hasValuesAsNames()) {
try {
--> currentAttribute.initValuesAsNames();
} catch(IllegalArgumentException e) {
log.warn("Incompatible attributes; changed attribute has Name values but " +
"original cannot be converted to this");
}
}

The NullPointerException is where I have placed the arrow. There is a check farther down in the code to see if currentAttribute is null, but no check in this spot, before trying to make a call against it.