Skip to content

Commit

Permalink
Fix nullptr exception
Browse files Browse the repository at this point in the history
  • Loading branch information
tdrwenski committed Oct 3, 2024
1 parent 7c03450 commit 82b0ee1
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 82b0ee1

Please sign in to comment.