You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2014/02/10 16:58:57 UTC

[1/2] git commit: Avoid potential NPE

Updated Branches:
  refs/heads/camel-2.12.x 352bfc3c5 -> 630149b1a
  refs/heads/master 4bcf10887 -> 1099b8ce9


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/1099b8ce
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1099b8ce
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1099b8ce

Branch: refs/heads/master
Commit: 1099b8ce94a928b5b111ff859793ca85168c5eab
Parents: 4bcf108
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Feb 10 16:59:48 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Feb 10 16:59:48 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/1099b8ce/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 bfbbe88..75a4610 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
@@ -408,8 +408,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 {


[2/2] git commit: Avoid potential NPE

Posted by da...@apache.org.
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 <da...@apache.org>
Authored: Mon Feb 10 16:59:48 2014 +0100
Committer: Claus Ibsen <da...@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 {