You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/11/03 18:35:45 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #5649: Handle NullPointerException when sending email alerts

DaanHoogland commented on a change in pull request #5649:
URL: https://github.com/apache/cloudstack/pull/5649#discussion_r742227363



##########
File path: server/src/main/java/com/cloud/alert/AlertManagerImpl.java
##########
@@ -706,14 +707,13 @@ public void sendAlert(AlertType alertType, long dataCenterId, Long podId, Long c
             newAlert.setName(alertType.getName());
             _alertDao.persist(newAlert);
         } else {
-            if (s_logger.isDebugEnabled()) {
-                    s_logger.debug("Have already sent: " + alert.getSentCount() + " emails for alert type '" + alertType + "' -- skipping send email");
-                }
+            logger.debug("Have already sent: " + alert.getSentCount() + " emails for alert type '" + alertType + "' -- skipping send email");

Review comment:
       why remove the level check?
   ```suggestion
               if (logger.isDebugEnabled()) {
                   logger.debug("Have already sent: " + alert.getSentCount() + " emails for alert type '" + alertType + "' -- skipping send email");
               }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org