Skip to content

Commit

Permalink
Merge branch 'backport-4176' into release-2.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Coduz committed Jan 20, 2025
2 parents d8c12d1 + b0381c4 commit b16e1e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ public void setCreatedBy(KapuaId createdBy) {
@PrePersist
protected void prePersistsAction() {
setId(new KapuaEid(IdGenerator.generate()));
setCreatedBy(KapuaSecurityUtils.getSession().getUserId());
if (KapuaSecurityUtils.getSession() != null) {
setCreatedBy(KapuaSecurityUtils.getSession().getUserId());
}
setCreatedOn(new Date());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ protected void prePersistsAction() {
*/
@PreUpdate
protected void preUpdateAction() {
setModifiedBy(KapuaSecurityUtils.getSession().getUserId());
if (KapuaSecurityUtils.getSession() != null) {
setModifiedBy(KapuaSecurityUtils.getSession().getUserId());
}
setModifiedOn(new Date());
}
}

0 comments on commit b16e1e1

Please sign in to comment.