From dc84f94a17b86df95d10c8b5d551aa31a835287e Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 16 Mar 2022 08:29:19 +1100 Subject: [PATCH] fix NPE processing markdown --- .../java/org/hl7/fhir/r5/conformance/ProfileUtilities.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java index ec0032ca8..990860155 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java @@ -2524,6 +2524,9 @@ public class ProfileUtilities extends TranslatingUtilities { } public static String processRelativeUrls(String markdown, String webUrl, String basePath, List resourceNames, Set filenames, boolean processRelatives) { + if (markdown == null) { + return ""; + } StringBuilder b = new StringBuilder(); int i = 0; while (i < markdown.length()) { @@ -2818,7 +2821,9 @@ public class ProfileUtilities extends TranslatingUtilities { ElementDefinition e = profile.getSnapshot().getElement().get(0); String webroot = profile.getUserString("webroot"); - base.setDefinition(processRelativeUrls(e.getDefinition(), webroot, baseSpecUrl(), context.getResourceNames(), masterSourceFileNames, true)); + if (e.hasDefinition()) { + base.setDefinition(processRelativeUrls(e.getDefinition(), webroot, baseSpecUrl(), context.getResourceNames(), masterSourceFileNames, true)); + } base.setShort(e.getShort()); if (e.hasCommentElement()) base.setCommentElement(e.getCommentElement());