]> source.dussan.org Git - gitblit.git/commitdiff
Do not queue emails with no recipients (issue 200)
authorJames Moger <james.moger@gitblit.com>
Thu, 28 Mar 2013 20:58:40 +0000 (16:58 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 28 Mar 2013 20:58:40 +0000 (16:58 -0400)
releases.moxie
src/main/java/com/gitblit/GitBlit.java

index 3667326d801da842e20ca420fed9784fbdfac11d..d79c1a45cb10eb2f3296c08f596f20a7b2d1b22a 100644 (file)
@@ -10,6 +10,7 @@ r17: {
         - Fix NPE when getting user's fork without repository list caching (issue 182)\r
         - Fix internal error on folder history links (issue 192)\r
         - Fixed incorrect icon file name for .doc files (issue 200)\r
+        - Do not queue emails with no recipients (issue 201)\r
 \r
     additions: \r
         - Option to force client-side basic authentication instead of form-based authentication if web.authenticateViewPages=true (issue 222)\r
index 2361a6e4a3bb8e2e843493dbca3fae24e2b0a416..b8daa06ce6359708b821dd2b23b9f75955e79ef6 100644 (file)
@@ -2903,6 +2903,10 @@ public class GitBlit implements ServletContextListener {
         * @param toAddresses\r
         */\r
        public void sendMail(String subject, String message, String... toAddresses) {\r
+               if (toAddresses == null || toAddresses.length == 0) {\r
+                       logger.debug(MessageFormat.format("Dropping message {0} because there are no recipients", subject));\r
+                       return;\r
+               }\r
                try {\r
                        Message mail = mailExecutor.createMessage(toAddresses);\r
                        if (mail != null) {\r
@@ -2934,6 +2938,10 @@ public class GitBlit implements ServletContextListener {
         * @param toAddresses\r
         */\r
        public void sendHtmlMail(String subject, String message, String... toAddresses) {\r
+               if (toAddresses == null || toAddresses.length == 0) {\r
+                       logger.debug(MessageFormat.format("Dropping message {0} because there are no recipients", subject));\r
+                       return;\r
+               }\r
                try {\r
                        Message mail = mailExecutor.createMessage(toAddresses);\r
                        if (mail != null) {\r