Skip to content

Commit 72ea965

Browse files
NativeImageResourceFileSystem should throw NPE when uri is null.
1 parent 5975f9f commit 72ea965

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/resources/NativeImageResourceFileSystemProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import java.nio.file.attribute.FileAttributeView;
5050
import java.nio.file.spi.FileSystemProvider;
5151
import java.util.Map;
52+
import java.util.Objects;
5253
import java.util.Set;
5354
import java.util.concurrent.locks.Lock;
5455
import java.util.concurrent.locks.ReadWriteLock;
@@ -140,6 +141,7 @@ public FileSystem newFileSystem(Path path, Map<String, ?> env) {
140141
public FileSystem getFileSystem(URI uri) {
141142
try {
142143
readLock.lock();
144+
Objects.requireNonNull(uri);
143145
if (fileSystem == null) {
144146
throw new FileSystemNotFoundException("The Native Image Resource File System is not present. " +
145147
"Please create a new file system using the `newFileSystem` operation before attempting any file system operations on resource URIs.");

0 commit comments

Comments
 (0)