Skip to content

Commit

Permalink
Synchronization utils NPE fix
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Oct 28, 2020
1 parent 4eb228b commit be0cbba
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -166,11 +166,17 @@ public static boolean isPolicyApplicable(QName objectClass, ShadowKindType kind,
ObjectClassComplexTypeDefinition policyObjectClass = null;
if (StringUtils.isEmpty(policyIntent)) {
policyObjectClass = schema.findDefaultObjectClassDefinition(policyKind);
policyIntent = policyObjectClass.getIntent();
if (policyObjectClass != null) {
policyIntent = policyObjectClass.getIntent();
}
} else {
policyObjectClass = schema.findObjectClassDefinition(policyKind, policyIntent);
}

if (policyObjectClass == null) {
return false;
}

// re-check objctClass if wasn't defined
if (objectClass != null && !QNameUtil.match(objectClass, policyObjectClass.getTypeName())) {
return false;
Expand Down

0 comments on commit be0cbba

Please sign in to comment.