Skip to content

Commit

Permalink
Fixing NPE in processing protected objects
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Jun 16, 2015
1 parent 99c633c commit 35d1bdd
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -472,11 +472,17 @@ private static ResourceObjectPattern convertToPattern(ResourceObjectPatternType
// Deprecated
if (patternType.getName() != null) {
RefinedAttributeDefinition<String> attributeDefinition = rAccountDef.findAttributeDefinition(new QName(SchemaConstants.NS_ICF_SCHEMA,"name"));
if (attributeDefinition == null) {
throw new SchemaException("No ICF NAME attribute in schema as specified in the definition of protected objects (this is deprecated syntax anyway, convert it to filter)");
}
ResourceAttribute<String> attr = attributeDefinition.instantiate();
attr.setRealValue(patternType.getName());
resourceObjectPattern.addIdentifier(attr);
} else if (patternType.getUid() != null) {
RefinedAttributeDefinition attributeDefinition = rAccountDef.findAttributeDefinition(new QName(SchemaConstants.NS_ICF_SCHEMA,"uid"));
if (attributeDefinition == null) {
throw new SchemaException("No ICF UID attribute in schema as specified in the definition of protected objects (this is deprecated syntax anyway, convert it to filter)");
}
ResourceAttribute<String> attr = attributeDefinition.instantiate();
attr.setRealValue(patternType.getName());
resourceObjectPattern.addIdentifier(attr);
Expand Down

0 comments on commit 35d1bdd

Please sign in to comment.