diff --git a/src/edu/stanford/bmir/protege/web/server/notes/OWLAPINotesManagerNotesAPIImpl.java b/src/edu/stanford/bmir/protege/web/server/notes/OWLAPINotesManagerNotesAPIImpl.java index 954795cf40..7641df24e0 100644 --- a/src/edu/stanford/bmir/protege/web/server/notes/OWLAPINotesManagerNotesAPIImpl.java +++ b/src/edu/stanford/bmir/protege/web/server/notes/OWLAPINotesManagerNotesAPIImpl.java @@ -226,8 +226,11 @@ private AnnotatableThing getAnnotatableThingForObjectId(NoteId noteId) { @Override public void deleteNoteAndReplies(NoteId noteId) { - notesManager.deleteNote(noteId.getLexicalForm()); - project.getEventManager().postEvent(new NoteDeletedEvent(project.getProjectId(), noteId)); + Annotation note = notesManager.getNote(noteId.getLexicalForm()); + if (note != null) { + notesManager.deleteNote(noteId.getLexicalForm()); + project.getEventManager().postEvent(new NoteDeletedEvent(project.getProjectId(), noteId)); + } }