diff options
author | James Moger <james.moger@gitblit.com> | 2013-03-28 16:58:40 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-03-28 16:58:40 -0400 |
commit | 4aeec822d0fe9306c4ca64f1a1d9683f77684198 (patch) | |
tree | 4517f44f4340edb49360f49a837a4dd64c313f34 /src/main/java | |
parent | a9e6d5d9207c497c0f2b1e515dc4af05b2316397 (diff) | |
download | gitblit-4aeec822d0fe9306c4ca64f1a1d9683f77684198.tar.gz gitblit-4aeec822d0fe9306c4ca64f1a1d9683f77684198.zip |
Do not queue emails with no recipients (issue 200)
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/gitblit/GitBlit.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java index 2361a6e4..b8daa06c 100644 --- a/src/main/java/com/gitblit/GitBlit.java +++ b/src/main/java/com/gitblit/GitBlit.java @@ -2903,6 +2903,10 @@ public class GitBlit implements ServletContextListener { * @param toAddresses
*/
public void sendMail(String subject, String message, String... toAddresses) {
+ if (toAddresses == null || toAddresses.length == 0) {
+ logger.debug(MessageFormat.format("Dropping message {0} because there are no recipients", subject));
+ return;
+ }
try {
Message mail = mailExecutor.createMessage(toAddresses);
if (mail != null) {
@@ -2934,6 +2938,10 @@ public class GitBlit implements ServletContextListener { * @param toAddresses
*/
public void sendHtmlMail(String subject, String message, String... toAddresses) {
+ if (toAddresses == null || toAddresses.length == 0) {
+ logger.debug(MessageFormat.format("Dropping message {0} because there are no recipients", subject));
+ return;
+ }
try {
Message mail = mailExecutor.createMessage(toAddresses);
if (mail != null) {
|