Merge pull request #180 from hapifhir/validator_throws_array_oob
Fix for array index out of bounds exception on adding profile for val…
This commit is contained in:
commit
f9521c326a
|
@ -92,19 +92,20 @@ public class Params {
|
||||||
i++; // ignore next parameter
|
i++; // ignore next parameter
|
||||||
} else if (args[i].equals(PROFILE)) {
|
} else if (args[i].equals(PROFILE)) {
|
||||||
String p = null;
|
String p = null;
|
||||||
if (i + 1 == args.length)
|
if (i + 1 == args.length) {
|
||||||
throw new Error("Specified -profile without indicating profile source");
|
throw new Error("Specified -profile without indicating profile source");
|
||||||
else {
|
} else {
|
||||||
p = args[++i];
|
p = args[++i];
|
||||||
cliContext.addProfile(args[++i]);
|
cliContext.addProfile(args[i++]);
|
||||||
}
|
}
|
||||||
if (p != null && i + 1 < args.length && args[i + 1].equals("@")) {
|
if (p != null && i + 1 < args.length && args[i + 1].equals("@")) {
|
||||||
i++;
|
i++;
|
||||||
if (i + 1 == args.length)
|
if (i + 1 == args.length) {
|
||||||
throw new Error("Specified -profile with @ without indicating profile location");
|
throw new Error("Specified -profile with @ without indicating profile location");
|
||||||
else
|
} else {
|
||||||
cliContext.addLocation(p, args[++i]);
|
cliContext.addLocation(p, args[++i]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (args[i].equals(QUESTIONNAIRE)) {
|
} else if (args[i].equals(QUESTIONNAIRE)) {
|
||||||
if (i + 1 == args.length)
|
if (i + 1 == args.length)
|
||||||
throw new Error("Specified -questionnaire without indicating questionnaire file");
|
throw new Error("Specified -questionnaire without indicating questionnaire file");
|
||||||
|
|
Loading…
Reference in New Issue