Skip to content

Commit

Permalink
avoid NPE when checking lock state for a document
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Sep 9, 2024
1 parent 5aa15a0 commit a4bd9f6
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6504,6 +6504,10 @@ public void setDocumentLock(String docId, boolean locked, boolean force) throws
@RolesAllowed({"loginRole"})
public boolean isDocumentLocked(String docId) throws Exception {
ArchiveFileDocumentsBean db = this.archiveFileDocumentsFacade.find(docId);
if(db==null) {
log.warn("There is no document with ID " + docId + " - assuming unlocked.");
return false;
}
return db.isLocked();
}

Expand Down

0 comments on commit a4bd9f6

Please sign in to comment.