Skip to content

Commit

Permalink
XWIKI-12179: MailSenderScriptService will throw a nullpointerexceptio…
Browse files Browse the repository at this point in the history
…n if there is any issue instead of returning null

  * Bulletproof the API by checking if the result is null before using
    it
  • Loading branch information
surli committed Feb 8, 2024
1 parent 6872d3e commit 07efa15
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ public ScriptMailResult send(Iterable<? extends MimeMessage> messages, String hi
{
ScriptMailResult scriptMailResult = sendAsynchronously(messages, hint);

// Wait for all messages from this batch to have been sent before returning
scriptMailResult.getStatusResult().waitTillProcessed(Long.MAX_VALUE);
if (scriptMailResult != null) {
// Wait for all messages from this batch to have been sent before returning
scriptMailResult.getStatusResult().waitTillProcessed(Long.MAX_VALUE);
}

return scriptMailResult;
}
Expand Down

0 comments on commit 07efa15

Please sign in to comment.