Commit 0506bd25 authored by Matija Obreza's avatar Matija Obreza

Fix: FolderNotEmptyException is thrown for no good reason

- JPA caches getFiles()
parent 577005e0
Pipeline #12978 passed with stage
in 2 minutes and 12 seconds
......@@ -1000,7 +1000,7 @@ public class RepositoryServiceImpl implements RepositoryService, InitializingBea
RepositoryFolder folder = folderRepository.findByPath(cPath.toString());
if (folder != null) {
if (folder.getChildren().size() > 0 || folder.getFiles().size() > 0) {
if (folder.getChildren().size() > 0 || repositoryFilePersistence.countByFolder(folder) > 0) {
throw new FolderNotEmptyException("Folder " + path.toString() + " is not empty.");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment