Skip to content

Commit

Permalink
more single node bug fix for associated documents
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavis95 committed Mar 23, 2022
1 parent 6f7ea1c commit 0d0204a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ public InputStream getAssociatedDocumentStream(String uniqueId, String filename)
public List<String> getAssociatedFilenames(String uniqueId) throws Exception {
String pathForUniqueId = getFullPathToUniqueId(uniqueId);

Stream<Path> list = Files.list(Path.of(pathForUniqueId));
return list.map(Path::toFile).map(File::getName).collect(Collectors.toList());
Path p = Path.of(pathForUniqueId);
if (Files.exists(p)) {
Stream<Path> list = Files.list(p);
return list.map(Path::toFile).map(File::getName).collect(Collectors.toList());
}
return Collections.emptyList();
}

@Override
Expand Down

0 comments on commit 0d0204a

Please sign in to comment.