The observer (SendMailOnFileManagerStorageSpaceLimitreachedObserver) that sends mails when the storage limit is reached is listening to too many events, such as the adding of a file in resources explorer. This causes an error in the logs since no project is found.
Steps to reproduce :
- Open resources explorer
- Add a file anywhere
- An error pops in the logs :
java.lang.NullPointerException: Cannot invoke "org.ametys.plugins.workspaces.project.objects.Project.getExplorerRootNode()" because "project" is null at org.ametys.plugins.workspaces.documents.DocumentWorkspaceModule.getModuleRoot(DocumentWorkspaceModule.java:303) at org.ametys.plugins.workspaces.documents.DocumentWorkspaceModule.getModuleSize(DocumentWorkspaceModule.java:266) at org.ametys.plugins.workspaces.documents.WorkspaceExplorerResourceDAO.getUsedStorageSpaceByProject(WorkspaceExplorerResourceDAO.java:1970) at org.ametys.plugins.workspaces.documents.SendMailOnFileManagerStorageSpaceLimitreachedObserver.observe(SendMailOnFileManagerStorageSpaceLimitreachedObserver.java:107) at org.ametys.core.observation.ObservationManager$ParallelAsyncObserve._observe(ObservationManager.java:512) at org.ametys.core.observation.ObservationManager$AbstractAsyncObserve.call(ObservationManager.java:449) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583)