Skip to content

Commit

Permalink
UBO-373 Fixed NullPointerException, store realm attribute of user in …
Browse files Browse the repository at this point in the history
…MCRJob (#438)
  • Loading branch information
Possommi authored Nov 28, 2024
1 parent e72137a commit e4b4a5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ private void handleImportJob(HttpServletRequest req, HttpServletResponse res) th
if ("true".equals(doAsync)) {
MCRJob job = new MCRJob(ImportListJobAction.class);
job.setParameter(ImportListJobAction.EDITOR_SUBMISSION_PARAMETER, new XMLOutputter().outputString(doc));
job.setParameter(ImportListJobAction.USER_ID_PARAMETER, MCRUserManager.getCurrentUser().getUserName());
job.setParameter(ImportListJobAction.USER_ID_PARAMETER,
MCRUserManager.getCurrentUser().getUserName() + "@" + MCRUserManager.getCurrentUser().getRealmID());
MCRJobQueueManager.getInstance().getJobQueue(ImportListJobAction.class).offer(job);

String referer = req.getHeader("Referer");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ public void execute() throws ExecutionException {
private void sendMail(ImportJob importJob) {
String userName = job.getParameter(ImportListJobAction.USER_ID_PARAMETER);
MCRUser mcrUser = MCRUserManager.getUser(userName);

if(mcrUser == null) {
LOGGER.error("User {} not found", userName);
return;
}

String eMailAddress = mcrUser.getEMailAddress();

if (eMailAddress == null) {
Expand Down

0 comments on commit e4b4a5c

Please sign in to comment.