fix npe rendering extensions + improve base64 presentation
This commit is contained in:
parent
2cb7c052af
commit
0004e06a5d
|
@ -420,7 +420,7 @@ public class DataRenderer extends Renderer implements CodeResolver {
|
||||||
|
|
||||||
private String getExtensionLabel(Extension ext) {
|
private String getExtensionLabel(Extension ext) {
|
||||||
StructureDefinition sd = context.getWorker().fetchResource(StructureDefinition.class, ext.getUrl());
|
StructureDefinition sd = context.getWorker().fetchResource(StructureDefinition.class, ext.getUrl());
|
||||||
if (sd != null && ext.getValue().isPrimitive() && sd.hasSnapshot()) {
|
if (sd != null && ext.hasValue() && ext.getValue().isPrimitive() && sd.hasSnapshot()) {
|
||||||
for (ElementDefinition ed : sd.getSnapshot().getElement()) {
|
for (ElementDefinition ed : sd.getSnapshot().getElement()) {
|
||||||
if (Utilities.existsInList(ed.getPath(), "Extension", "Extension.value[x]") && ed.hasLabel()) {
|
if (Utilities.existsInList(ed.getPath(), "Extension", "Extension.value[x]") && ed.hasLabel()) {
|
||||||
return ed.getLabel();
|
return ed.getLabel();
|
||||||
|
@ -728,7 +728,8 @@ public class DataRenderer extends Renderer implements CodeResolver {
|
||||||
} else if (type instanceof MarkdownType) {
|
} else if (type instanceof MarkdownType) {
|
||||||
addMarkdown(x, ((MarkdownType) type).asStringValue());
|
addMarkdown(x, ((MarkdownType) type).asStringValue());
|
||||||
} else if (type instanceof Base64BinaryType) {
|
} else if (type instanceof Base64BinaryType) {
|
||||||
x.tx("(base64 data)");
|
Base64BinaryType b64 = (Base64BinaryType) type;
|
||||||
|
x.tx("(base64 data - "+(b64.getValue() == null ? "0" : b64.getValue().length)+" bytes)");
|
||||||
} else if (type.isPrimitive()) {
|
} else if (type.isPrimitive()) {
|
||||||
x.tx(type.primitiveValue());
|
x.tx(type.primitiveValue());
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue