diff --git a/src/main/java/cz/cvut/kbss/termit/service/business/VocabularyService.java b/src/main/java/cz/cvut/kbss/termit/service/business/VocabularyService.java index e0374c4f8..ff5ec6430 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/business/VocabularyService.java +++ b/src/main/java/cz/cvut/kbss/termit/service/business/VocabularyService.java @@ -282,8 +282,9 @@ public void runTextAnalysisOnAllVocabularies() { @Transactional @PreAuthorize("@vocabularyAuthorizationService.canRemove(#asset)") public void remove(Vocabulary asset) { - aclService.findFor(asset).ifPresent(aclService::remove); - repositoryService.remove(asset); + Vocabulary toRemove = repositoryService.findRequired(asset.getUri()); + aclService.findFor(toRemove).ifPresent(aclService::remove); + repositoryService.remove(toRemove); } /**