mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
server: Fix NPE when no recipients configured for sending alerts (#5154)
* Fix NPE when no recipients configured for sending alerts * Adding logs * Address comments
This commit is contained in:
parent
50bf2861c0
commit
665142701d
@ -712,6 +712,11 @@ public class AlertManagerImpl extends ManagerBase implements AlertManager, Confi
|
||||
return;
|
||||
}
|
||||
|
||||
if (recipients == null) {
|
||||
s_logger.warn(String.format("No recipients set in 'alert.email.addresses', skipping sending alert with subject: %s and content: %s", subject, content));
|
||||
return;
|
||||
}
|
||||
|
||||
SMTPMailProperties mailProps = new SMTPMailProperties();
|
||||
mailProps.setSender(new MailAddress(senderAddress));
|
||||
mailProps.setSubject(subject);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user