camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] git commit: Avoid potential NPE
Date Mon, 10 Feb 2014 15:58:58 GMT
Avoid potential NPE


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/630149b1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/630149b1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/630149b1

Branch: refs/heads/camel-2.12.x
Commit: 630149b1ac9490bca6673b17ddd5e550d71f5ee7
Parents: 352bfc3
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Feb 10 16:59:48 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Feb 10 17:00:04 2014 +0100

----------------------------------------------------------------------
 .../apache/camel/management/mbean/ManagedCamelContext.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/630149b1/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
index a8f2571..62de546 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
@@ -407,8 +407,12 @@ public class ManagedCamelContext extends ManagedPerformanceCounter implements
Ti
 
     public String componentParameterJsonSchema(String componentName) throws Exception {
         Component component = context.getComponent(componentName);
-        ComponentConfiguration configuration = component.createComponentConfiguration();
-        return configuration.createParameterJsonSchema();
+        if (component != null) {
+            ComponentConfiguration configuration = component.createComponentConfiguration();
+            return configuration.createParameterJsonSchema();
+        } else {
+            return null;
+        }
     }
 
     public void reset(boolean includeRoutes) throws Exception {


Mime
View raw message