AMQ-4029: Check for null when unregister mbean.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1383270 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Claus Ibsen 2012-09-11 07:38:10 +00:00
parent 8a0dd39fb0
commit ece2e17b19
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ public class ManagementContext implements Service {
} }
// stop naming service mbean // stop naming service mbean
try { try {
if (getMBeanServer().isRegistered(namingServiceObjectName)) { if (namingServiceObjectName != null && getMBeanServer().isRegistered(namingServiceObjectName)) {
LOG.debug("Stopping MBean {}", namingServiceObjectName); LOG.debug("Stopping MBean {}", namingServiceObjectName);
getMBeanServer().invoke(namingServiceObjectName, "stop", null, null); getMBeanServer().invoke(namingServiceObjectName, "stop", null, null);
LOG.debug("Unregistering MBean {}", namingServiceObjectName); LOG.debug("Unregistering MBean {}", namingServiceObjectName);