From 92ea69fa8a3b55edb876cf6fe5d6915cbbc43a8b Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 11 Dec 2023 15:33:24 +1100 Subject: [PATCH] prevent NPE checking element definitions when no short definition provided --- .../org/hl7/fhir/definitions/validation/ResourceValidator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/hl7/fhir/definitions/validation/ResourceValidator.java b/src/main/java/org/hl7/fhir/definitions/validation/ResourceValidator.java index 07bc680f..86ba9c95 100644 --- a/src/main/java/org/hl7/fhir/definitions/validation/ResourceValidator.java +++ b/src/main/java/org/hl7/fhir/definitions/validation/ResourceValidator.java @@ -743,7 +743,7 @@ else if (parentInSummary) { warning(errors, ValidationMessage.NO_RULE_DATE, IssueType.STRUCTURE, path, e.unbounded(), "The max cardinality of 'note' must be *"); } String sd = e.getShortDefn(); - if (sd.length() > 0) { + if (sd != null && sd.length() > 0) { rule(errors, ValidationMessage.NO_RULE_DATE, IssueType.STRUCTURE, path, sd.contains("|") || Character.isUpperCase(sd.charAt(0)) || sd.startsWith("e.g. ") || !Character.isLetter(sd.charAt(0)) || Utilities.isURL(sd) || sd.startsWith("e.g. ") || startsWithType(sd), "Short Description must start with an uppercase character ('" + sd + "')"); rule(errors, ValidationMessage.NO_RULE_DATE, IssueType.STRUCTURE, path, !sd.endsWith(".") || sd.endsWith("etc."), "Short Description must not end with a period ('" + sd + "')"); rule(errors, ValidationMessage.NO_RULE_DATE, IssueType.STRUCTURE, path, e.getDefinition().contains("|") || Character.isUpperCase(e.getDefinition().charAt(0)) || !Character.isLetter(e.getDefinition().charAt(0)), "Long Description must start with an uppercase character ('" + e.getDefinition() + "')");