Skip to content

Commit

Permalink
Fix 500-error when no value policy in self-reg
Browse files Browse the repository at this point in the history
It should be fixed more seriously by avoiding exception-masking
loadObject method. This is only a quick hack.

(cherry picked from commit 0473679)
  • Loading branch information
mederly committed Feb 21, 2018
1 parent 921679b commit e84469f
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -688,6 +688,10 @@ private <O extends ObjectType> String generateNonce(NonceCredentialsPolicyType n
if (noncePolicy != null && noncePolicy.getValuePolicyRef() != null) {
PrismObject<ValuePolicyType> valuePolicy = WebModelServiceUtils.loadObject(ValuePolicyType.class,
noncePolicy.getValuePolicyRef().getOid(), PageSelfRegistration.this, task, result);
if (valuePolicy == null) {
LOGGER.error("Nonce cannot be generated, as value policy {} cannot be fetched", noncePolicy.getValuePolicyRef().getOid());
throw new ObjectNotFoundException("Nonce cannot be generated"); // no more information (security); TODO implement more correctly
}
policy = valuePolicy.asObjectable();
}

Expand Down

0 comments on commit e84469f

Please sign in to comment.