Merge pull request #461 from realizm/master

Fixing exception when validation issues #458
This commit is contained in:
Grahame Grieve 2021-03-29 08:54:47 +10:00 committed by GitHub
commit eecf74576f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1056,7 +1056,7 @@ public class ProfileUtilities extends TranslatingUtilities {
baseCursor = indexOfFirstNonChild(base, currentBase, baseCursor+1, baseLimit); baseCursor = indexOfFirstNonChild(base, currentBase, baseCursor+1, baseLimit);
} else { } else {
if (outcome.getType().size() == 0) { if (outcome.getType().size() == 0) {
throw new DefinitionException(context.formatMessage(I18nConstants._HAS_NO_CHILDREN__AND_NO_TYPES_IN_PROFILE_, diffMatches.get(0).getPath(), differential.getElement().get(diffCursor).getPath(), profileName)); throw new DefinitionException(context.formatMessage(I18nConstants._HAS_NO_CHILDREN__AND_NO_TYPES_IN_PROFILE_, cpath, differential.getElement().get(diffCursor).getPath(), profileName));
} }
boolean nonExtension = false; boolean nonExtension = false;
if (outcome.getType().size() > 1) { if (outcome.getType().size() > 1) {
@ -1075,7 +1075,7 @@ public class ProfileUtilities extends TranslatingUtilities {
} }
StructureDefinition dt = outcome.getType().size() > 1 ? context.fetchTypeDefinition("Element") : getProfileForDataType(outcome.getType().get(0)); StructureDefinition dt = outcome.getType().size() > 1 ? context.fetchTypeDefinition("Element") : getProfileForDataType(outcome.getType().get(0));
if (dt == null) { if (dt == null) {
throw new DefinitionException(context.formatMessage(I18nConstants.UNKNOWN_TYPE__AT_, outcome.getType().get(0), diffMatches.get(0).getPath())); throw new DefinitionException(context.formatMessage(I18nConstants.UNKNOWN_TYPE__AT_, outcome.getType().get(0), cpath));
} }
contextName = dt.getUrl(); contextName = dt.getUrl();
int start = diffCursor; int start = diffCursor;