Skip to content

Commit d0ed3d0

Browse files
committed
Fixed failing test due to nullpointer
1 parent 302690e commit d0ed3d0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/nl/esciencecenter/xenon/adaptors/filesystems/ftp/FtpFileSystem.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,15 @@ protected void deleteFile(Path path) throws XenonException {
312312
public boolean exists(Path path) throws XenonException {
313313

314314
try {
315-
if (path.isEmpty()) {
315+
Path tmp = toAbsolutePath(path);
316+
317+
if (tmp.isEmpty()) {
316318
// special case for root. We assume it always exists.
317319
return true;
318320
}
319321

320322
// otherwise, we try to get stats on the file or directory
321-
getFTPFileInfo(toAbsolutePath(path));
323+
getFTPFileInfo(tmp);
322324
return true;
323325
} catch (NoSuchPathException e) {
324326
return false;

0 commit comments

Comments
 (0)