Skip to content

Commit

Permalink
Merge pull request #542 from tdrwenski/fix-nullptr-exception
Browse files Browse the repository at this point in the history
Fix nullptr exception
  • Loading branch information
tdrwenski authored Oct 3, 2024
2 parents 7c03450 + 82b0ee1 commit f7f0d32
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ private List<MFile> getSubDirs(MFile directory) {

final CollectionConfig dirs = new CollectionConfig("dirs", directory.getPath(), false, null, null);
final Iterator<MFile> dirIterator = mController.getSubdirs(dirs, true);
dirIterator.forEachRemaining(mFiles::add);
if (dirIterator != null) {
dirIterator.forEachRemaining(mFiles::add);
}

return mFiles;
}
Expand All @@ -534,7 +536,9 @@ private List<MFile> getFiles(MFile directory) throws IOException {

final CollectionConfig files = new CollectionConfig("files", directory.getPath(), false, null, null);
final Iterator<MFile> fileIterator = mController.getInventoryTop(files, true);
fileIterator.forEachRemaining(mFiles::add);
if (fileIterator != null) {
fileIterator.forEachRemaining(mFiles::add);
}

return mFiles;
}
Expand Down

0 comments on commit f7f0d32

Please sign in to comment.