diff --git a/src/main/java/cpw/mods/niofs/union/UnionFileSystem.java b/src/main/java/cpw/mods/niofs/union/UnionFileSystem.java index 905c096..b0f3d98 100644 --- a/src/main/java/cpw/mods/niofs/union/UnionFileSystem.java +++ b/src/main/java/cpw/mods/niofs/union/UnionFileSystem.java @@ -453,7 +453,8 @@ private boolean testFilter(final Path path, final Path basePath) { var sPath = path.toString(); if (path.getFileSystem() == basePath.getFileSystem()) // Directories, zips will be different file systems. sPath = basePath.relativize(path).toString().replace('\\', '/'); - if (Files.isDirectory(path)) + var attrs = getFileAttributes(path); + if (attrs.isPresent() && attrs.get().isDirectory()) sPath += '/'; if (sPath.length() > 1 && sPath.startsWith("/")) sPath = sPath.substring(1);