Stop recursive rendering crash

This commit is contained in:
Grahame Grieve 2024-06-26 19:32:40 +10:00
parent b5539db606
commit 94937c9d30
1 changed files with 15 additions and 10 deletions

View File

@ -245,18 +245,23 @@ public abstract class ResourceRenderer extends DataRenderer {
actual = type;
}
if (actual != null && actual.hasPrimitiveValue()) {
ResourceWithReference rr = resolveReference(actual);
if (rr == null) {
String disp = display != null && display.hasPrimitiveValue() ? displayDataType(display) : actual.primitiveValue();
return "->"+disp;
System.out.println("displayReference: "+actual);
if ("#".equals(actual.primitiveValue())) {
return "this resource";
} else {
String disp;
try {
disp = display != null && display.hasPrimitiveValue() ? displayDataType(display) : RendererFactory.factory(rr.getResource(), context.forContained()).buildSummary(rr.getResource());
} catch (IOException e) {
disp = e.getMessage();
ResourceWithReference rr = resolveReference(actual);
if (rr == null) {
String disp = display != null && display.hasPrimitiveValue() ? displayDataType(display) : actual.primitiveValue();
return "->"+disp;
} else {
String disp;
try {
disp = display != null && display.hasPrimitiveValue() ? displayDataType(display) : RendererFactory.factory(rr.getResource(), context.forContained()).buildSummary(rr.getResource());
} catch (IOException e) {
disp = e.getMessage();
}
return "->"+disp;
}
return "->"+disp;
}
} else if (display != null) {
return "->"+display;