Closed infeo closed 2 years ago
The JDK filesystem API takes an arbitrary Path as an argument. Hence, also for the filesystem root the following is a valid method call:
Path root = fs.getPath("/"); Files.createDirectory(root);
Although the above will likely throw an exception, it should be an IOException. Currently, a NullPointerException is thrown, caused by https://github.com/cryptomator/cryptofs/blob/59a8ec29d9a834f10a36a53202720b72020b5475/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemImpl.java#L630-L635.
IOException
NullPointerException
We need some null-check for Path::getFileName. Additionally, we should check which other methods choke on the root path.
Path::getFileName
The JDK filesystem API takes an arbitrary Path as an argument. Hence, also for the filesystem root the following is a valid method call:
Although the above will likely throw an exception, it should be an
IOException
. Currently, aNullPointerException
is thrown, caused by https://github.com/cryptomator/cryptofs/blob/59a8ec29d9a834f10a36a53202720b72020b5475/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemImpl.java#L630-L635.We need some null-check for
Path::getFileName
. Additionally, we should check which other methods choke on the root path.