Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Aug 4, 2015
2 parents bb22e51 + 334df38 commit 0db32de
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -394,22 +394,28 @@ public void visit(Visitable visitable) {
if (visitable instanceof PrismReferenceValue) {
PrismReferenceValue refVal = (PrismReferenceValue) visitable;
PrismObject<?> refObject = refVal.getObject();
String name = null;
if (refObject == null) {
try {
// TODO what about security here?!
// TODO use some minimalistic get options (e.g. retrieve name only)
refObject = objectResolver.resolve(refVal, "", rootOptionsNoResolve, task, result);
if (refObject == null) { // will be used with AllowNotFound above
name = "(object not found)";
}
} catch (ObjectNotFoundException e) {
// actually, this won't occur if AllowNotFound is set to true above (however, for now, it is not)
result.muteError();
result.muteLastSubresultError();
name = "(object not found)";
} catch (RuntimeException e) {
result.muteError();
result.muteLastSubresultError();
name = "(object cannot be retrieved)";
}
}
String name;
if (refObject != null) {
name = PolyString.getOrig(refObject.asObjectable().getName());
} else {
name = "(object not found)";
}
if (StringUtils.isNotEmpty(name)) {
refVal.setUserData(XNodeSerializer.USER_DATA_KEY_COMMENT, " " + name + " ");
Expand Down

0 comments on commit 0db32de

Please sign in to comment.