Author: ffang
Date: Thu Oct 25 02:16:44 2012
New Revision: 1401953

URL: http://svn.apache.org/viewvc?rev=1401953&view=rev
Log:
[SMX4NMR-304]add NPE guard for AbstractComponentContext.getMBeanServer

Modified:
    
servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/AbstractComponentContext.java

Modified: 
servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/AbstractComponentContext.java
URL: 
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/AbstractComponentContext.java?rev=1401953&r1=1401952&r2=1401953&view=diff
==============================================================================
--- 
servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/AbstractComponentContext.java
 (original)
+++ 
servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/AbstractComponentContext.java
 Thu Oct 25 02:16:44 2012
@@ -228,7 +228,11 @@ public abstract class AbstractComponentC
     }
 
     public MBeanServer getMBeanServer() {
-        return componentRegistry.getEnvironment().getMBeanServer();
+        if (componentRegistry.getEnvironment() != null) {
+            return componentRegistry.getEnvironment().getMBeanServer();
+        } else {
+            return null;
+        }
     }
 
     public InitialContext getNamingContext() {


Reply via email to