Fix NPE when validating parent directory of a file

This commit is contained in:
Paul Schaub 2018-11-15 22:39:16 +01:00
parent f049f09e97
commit 3c9344dcef
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -72,7 +72,7 @@ public class InputValidator {
*/
public static File validateOutputPath(String path) throws InvalidOptionException {
File file = new File(path);
File parent = file.getParentFile();
File parent = file.getAbsoluteFile().getParentFile();
if (!parent.exists() || parent.isFile()) {
throw new InvalidOptionException("Invalid directory " + parent.getAbsolutePath());
}