From e1ce3821c02156d598d22959a4fc0203974fe1d1 Mon Sep 17 00:00:00 2001 From: alanb Date: Fri, 6 Jan 2012 15:00:22 +0000 Subject: [PATCH] 7127235: (fs) NPE in Files.walkFileTree if cached attributes are GC'ed Reviewed-by: forax, chegar --- src/share/classes/java/nio/file/FileTreeWalker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/classes/java/nio/file/FileTreeWalker.java b/src/share/classes/java/nio/file/FileTreeWalker.java index 6e1a83ff1..7b1f43fe4 100644 --- a/src/share/classes/java/nio/file/FileTreeWalker.java +++ b/src/share/classes/java/nio/file/FileTreeWalker.java @@ -92,7 +92,7 @@ class FileTreeWalker { (System.getSecurityManager() == null)) { BasicFileAttributes cached = ((BasicFileAttributesHolder)file).get(); - if (!followLinks || !cached.isSymbolicLink()) + if (cached != null && (!followLinks || !cached.isSymbolicLink())) attrs = cached; } IOException exc = null; -- GitLab