Skip to content

Commit

Permalink
#20: AbstractFakeFileSystem: Fix NullPointerException in `listFiles…
Browse files Browse the repository at this point in the history
…()` and `listNames()` if file was deleted or renamed.
  • Loading branch information
chrismair committed May 15, 2024
1 parent 61ef5c0 commit 17ae4f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
TODO: Version 3.2.0 (??? 2023)
------------------------------------------
- #21: FakeFtpServer: Add support for the SIZE command.([Edoardo Luppi](https://github.com/lppedd))
- #20: `AbstractFakeFileSystem`: Fix NullPointerException in `listFiles()` and `listNames()` if file was deleted or renamed.

Infrastructure and Dependencies
- Upgrade Spring Framework test dependency to 5.3.30.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ public List listFiles(String path) {
while (iter.hasNext()) {
String childPath = (String) iter.next();
FileSystemEntry fileSystemEntry = getEntry(childPath);
entryList.add(fileSystemEntry);
if (fileSystemEntry != null) {
entryList.add(fileSystemEntry);
}
}
return entryList;
}
Expand Down Expand Up @@ -249,7 +251,9 @@ public List listNames(String path) {
while (iter.hasNext()) {
String childPath = (String) iter.next();
FileSystemEntry fileSystemEntry = getEntry(childPath);
filenames.add(fileSystemEntry.getName());
if (fileSystemEntry != null) {
filenames.add(fileSystemEntry.getName());
}
}
return filenames;
}
Expand Down

0 comments on commit 17ae4f5

Please sign in to comment.