hotfix-4.5.x: minor bug fixed. If no path at all was provided for the variant-annotation output, i.e. -o test.json.gz rather than -o ./test.json.gz, an error was raised. This is now checked and error avoided.
@@ -743,12 +743,15 @@ public class VariantAnnotationCommandExecutor extends CommandExecutor {
// output file
if (variantAnnotationCommandOptions.output != null) {
output = Paths.get(variantAnnotationCommandOptions.output);
-// Path outputDir = output.getParent();
+ // output.getParent may be null if for example the output is specified with no path at all, i.e
+ // -o test.vcf rather than -o ./test.vcf
+ if (output.getParent() != null) {
try {
FileUtils.checkDirectory(output.getParent());
} catch (IOException e) {
throw new ParameterException(e);
}
+ }
// if (!outputDir.toFile().exists()) {
// throw new ParameterException("Output directory " + outputDir + " doesn't exist");
// } else if (output.toFile().isDirectory()) {
