NO-JIRA avoiding a NPE if the server is stopped

This commit is contained in:
Clebert Suconic 2018-08-02 10:57:14 -04:00
parent 3e4d65e14c
commit 77989c3763
1 changed files with 4 additions and 1 deletions

View File

@ -550,7 +550,10 @@ public class ManagementServiceImpl implements ManagementService {
@Override
public void activated() {
try {
messagingServer.addAddressInfo(new AddressInfo(managementNotificationAddress, RoutingType.MULTICAST));
ActiveMQServer usedServer = messagingServer;
if (usedServer != null) {
usedServer.addAddressInfo(new AddressInfo(managementNotificationAddress, RoutingType.MULTICAST));
}
} catch (Exception e) {
ActiveMQServerLogger.LOGGER.unableToCreateManagementNotificationAddress(managementNotificationAddress, e);
}