# HG changeset patch # User egahlin # Date 1565027936 -7200 # Node ID 3b41affae2d29dd03a634f7cb2b2b9814cb98ff7 # Parent f5f590eaecf596635b352273209039f9db89bbfb Fix NPE in SafePath diff -r f5f590eaecf5 -r 3b41affae2d2 src/jdk.jfr/share/classes/jdk/jfr/consumer/EventDirectoryStream.java --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventDirectoryStream.java Fri Aug 02 20:05:23 2019 +0200 +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventDirectoryStream.java Mon Aug 05 19:58:56 2019 +0200 @@ -59,7 +59,7 @@ public DirectoryStream(AccessControlContext acc, Path p) throws IOException { super(acc); - repositoryFiles = new RepositoryFiles(new SafePath(p)); + repositoryFiles = new RepositoryFiles(p == null ? null : new SafePath(p)); } @Override diff -r f5f590eaecf5 -r 3b41affae2d2 src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RepositoryFiles.java --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RepositoryFiles.java Fri Aug 02 20:05:23 2019 +0200 +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RepositoryFiles.java Mon Aug 05 19:58:56 2019 +0200 @@ -53,7 +53,7 @@ private volatile boolean closed; public RepositoryFiles(SafePath repository) { - this.repository = repository.toPath(); + this.repository = repository == null ? null : repository.toPath(); } public long getTimestamp(Path p) {