Skip to content

Commit

Permalink
fix in mkdir
Browse files Browse the repository at this point in the history
Change-Id: Icd30c23f5606431bbdbd690f52adec30453ee19d
  • Loading branch information
Gabor Bota committed Sep 19, 2019
1 parent 4a6d788 commit 17df4f0
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ protected void processNonexistentPath(PathData item) throws IOException {
// we want a/b
final Path itemPath = new Path(item.path.toString());
final Path itemParentPath = itemPath.getParent();

if(itemParentPath == null) {
throw new PathNotFoundException(String.format(
"Item: %s parent path's is null. This can happen if mkdir is " +
"called on root, so there's no parent.", itemPath.toString()));
}

if (!item.fs.exists(itemParentPath)) {
throw new PathNotFoundException(itemParentPath.toString());
}
Expand Down

0 comments on commit 17df4f0

Please sign in to comment.