Fix NPE when validating parent directory of a file
This commit is contained in:
parent
f049f09e97
commit
3c9344dcef
1 changed files with 1 additions and 1 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue