diff --git a/src/main/java/org/olat/modules/sharedfolder/SharedFolderWebDAVMergeSource.java b/src/main/java/org/olat/modules/sharedfolder/SharedFolderWebDAVMergeSource.java
index e0b32172d7d1e17e6e2e943bd9891c2a0e6fb718..824f6ccc47dfba8489a86f68f8c2f44b29df53e0 100644
--- a/src/main/java/org/olat/modules/sharedfolder/SharedFolderWebDAVMergeSource.java
+++ b/src/main/java/org/olat/modules/sharedfolder/SharedFolderWebDAVMergeSource.java
@@ -64,10 +64,12 @@ public class SharedFolderWebDAVMergeSource extends WebDAVMergeSource {
 		
 		List<RepositoryEntry> ownerEntries = repoManager.queryByMembership(getIdentity(), true, true, false, SharedFolderFileResource.TYPE_NAME);
 		for (RepositoryEntry entry : ownerEntries) {
-			VFSContainer container = sfm.getNamedSharedFolder(entry, true);
-			if(container != null) {
-				addContainerToList(container, containers);
-				addedEntries.add(entry.getKey());
+			if(entry != null && !addedEntries.contains(entry.getKey())) {
+				VFSContainer container = sfm.getNamedSharedFolder(entry, true);
+				if(container != null) {
+					addContainerToList(container, containers);
+					addedEntries.add(entry.getKey());
+				}
 			}
 		}
 		
@@ -77,7 +79,7 @@ public class SharedFolderWebDAVMergeSource extends WebDAVMergeSource {
 		}
 
 		// see /webapp/WEB-INF/classes/org/olat/core/commons/services/webdav/webdavContext.xml
-		if (publiclyReadableFolders != null && publiclyReadableFolders.size() > 0) {
+		if (publiclyReadableFolders != null && !publiclyReadableFolders.isEmpty()) {
 			// Temporarily save added entries. This is needed to make sure not to add an entry twice.
 			
 			String firstItem = publiclyReadableFolders.get(0);