mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-01-10 06:27:59 -05:00
GP-0: Fixing NPE in Batch Importer (#Closes #8191)
This commit is contained in:
@@ -266,12 +266,13 @@ public interface GFileSystem extends Closeable, Iterable<GFile>, ExtensionPoint
|
||||
/**
|
||||
* Gets an {@link Iterator} over this {@link GFileSystem}'s {@link GFile files}.
|
||||
*
|
||||
* @param dir The {@link GFile directory} to start iterating at in this {@link GFileSystem}
|
||||
* @param dir The {@link GFile directory} to start iterating at in this {@link GFileSystem}. If
|
||||
* {@code null}, iteration will start at the root of the {@link GFileSystem}.
|
||||
* @throws UncheckedIOException if {@code dir} is not a directory
|
||||
* @return An {@link Iterable} over this {@link GFileSystem}'s {@link GFile files}.
|
||||
*/
|
||||
default Iterable<GFile> files(GFile dir) throws UncheckedIOException {
|
||||
return () -> new GFileSystemIterator(dir);
|
||||
return () -> new GFileSystemIterator(Objects.requireNonNullElse(dir, getRootDir()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -287,14 +288,16 @@ public interface GFileSystem extends Closeable, Iterable<GFile>, ExtensionPoint
|
||||
/**
|
||||
* Gets an {@link Iterator} over this {@link GFileSystem}'s {@link GFile files}.
|
||||
*
|
||||
* @param dir The {@link GFile directory} to start iterating at in this {@link GFileSystem}
|
||||
* @param dir The {@link GFile directory} to start iterating at in this {@link GFileSystem}. If
|
||||
* {@code null}, iteration will start at the root of the {@link GFileSystem}.
|
||||
* @param fileFilter A filter to apply to the {@link GFile files} iterated over
|
||||
* @throws UncheckedIOException if {@code dir} is not a directory
|
||||
* @return An {@link Iterable} over this {@link GFileSystem}'s {@link GFile files}.
|
||||
*/
|
||||
default Iterable<GFile> files(GFile dir, Predicate<GFile> fileFilter)
|
||||
throws UncheckedIOException {
|
||||
return () -> new GFileSystemIterator(dir, fileFilter);
|
||||
return () -> new GFileSystemIterator(Objects.requireNonNullElse(dir, getRootDir()),
|
||||
fileFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user