Skip to content

Commit

Permalink
Fixing NPE on special ConnId attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Apr 26, 2016
1 parent ee6db87 commit d102875
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -162,12 +162,18 @@ <T extends ShadowType> PrismObject<T> convertToResourceObject(ConnectorObject co
if (icfAttr.getName().equals(OperationalAttributes.PASSWORD_NAME)) {
// password has to go to the credentials section
ProtectedStringType password = getSingleValue(icfAttr, ProtectedStringType.class);
if (password == null) {
continue;
}
ShadowUtil.setPassword(shadow, password);
LOGGER.trace("Converted password: {}", password);
continue;
}
if (icfAttr.getName().equals(OperationalAttributes.ENABLE_NAME)) {
Boolean enabled = getSingleValue(icfAttr, Boolean.class);
if (enabled == null) {
continue;
}
ActivationType activationType = ShadowUtil.getOrCreateActivation(shadow);
ActivationStatusType activationStatusType;
if (enabled) {
Expand All @@ -183,20 +189,29 @@ <T extends ShadowType> PrismObject<T> convertToResourceObject(ConnectorObject co

if (icfAttr.getName().equals(OperationalAttributes.ENABLE_DATE_NAME)) {
Long millis = getSingleValue(icfAttr, Long.class);
if (millis == null) {
continue;
}
ActivationType activationType = ShadowUtil.getOrCreateActivation(shadow);
activationType.setValidFrom(XmlTypeConverter.createXMLGregorianCalendar(millis));
continue;
}

if (icfAttr.getName().equals(OperationalAttributes.DISABLE_DATE_NAME)) {
Long millis = getSingleValue(icfAttr, Long.class);
if (millis == null) {
continue;
}
ActivationType activationType = ShadowUtil.getOrCreateActivation(shadow);
activationType.setValidTo(XmlTypeConverter.createXMLGregorianCalendar(millis));
continue;
}

if (icfAttr.getName().equals(OperationalAttributes.LOCK_OUT_NAME)) {
Boolean lockOut = getSingleValue(icfAttr, Boolean.class);
if (lockOut == null) {
continue;
}
if (lockOut != null){
ActivationType activationType = ShadowUtil.getOrCreateActivation(shadow);
LockoutStatusType lockoutStatusType;
Expand Down

0 comments on commit d102875

Please sign in to comment.