diff --git a/core/src/main/groovy/com/muwire/core/files/FileManager.groovy b/core/src/main/groovy/com/muwire/core/files/FileManager.groovy index d989739e..0c1297ef 100644 --- a/core/src/main/groovy/com/muwire/core/files/FileManager.groovy +++ b/core/src/main/groovy/com/muwire/core/files/FileManager.groovy @@ -119,11 +119,12 @@ class FileManager { void onUICommentEvent(UICommentEvent e) { if (e.oldComment != null) { def comment = DataUtil.readi18nString(Base64.decode(e.oldComment)) - index.remove(comment) Set existingFiles = commentToFile.get(comment) existingFiles.remove(e.sharedFile.getFile()) - if (existingFiles.isEmpty()) + if (existingFiles.isEmpty()) { commentToFile.remove(comment) + index.remove(comment) + } } String comment = e.sharedFile.getComment()