fix npe validating code system

This commit is contained in:
Grahame Grieve 2024-05-27 23:55:58 +10:00
parent 1087016941
commit ae250c4053
1 changed files with 16 additions and 12 deletions

View File

@ -296,6 +296,9 @@ public class ValueSetValidator extends BaseValidator {
cs = context.findTxResource(CodeSystem.class, system, version); cs = context.findTxResource(CodeSystem.class, system, version);
} }
if (cs != null) { // if it's null, we can't analyse this if (cs != null) { // if it's null, we can't analyse this
if (cs.getContent() == null) {
warning(errors, "2024-03-06", IssueType.INVALID, stack, false, version == null ? I18nConstants.VALUESET_INCLUDE_CS_CONTENT : I18nConstants.VALUESET_INCLUDE_CSVER_CONTENT, system, "null", version);
} else {
switch (cs.getContent()) { switch (cs.getContent()) {
case EXAMPLE: case EXAMPLE:
warning(errors, "2024-03-06", IssueType.INVALID, stack, false, version == null ? I18nConstants.VALUESET_INCLUDE_CS_CONTENT : I18nConstants.VALUESET_INCLUDE_CSVER_CONTENT, system, cs.getContent().toCode(), version); warning(errors, "2024-03-06", IssueType.INVALID, stack, false, version == null ? I18nConstants.VALUESET_INCLUDE_CS_CONTENT : I18nConstants.VALUESET_INCLUDE_CSVER_CONTENT, system, cs.getContent().toCode(), version);
@ -310,6 +313,7 @@ public class ValueSetValidator extends BaseValidator {
break; break;
} }
} }
}
boolean systemOk = true; boolean systemOk = true;
int cc = 0; int cc = 0;