camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/5] camel git commit: Fixed potential NPE if components create exchange the wrong way.
Date Sun, 18 Oct 2015 11:07:56 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 3a56fa8f6 -> e10513eb7


Fixed potential NPE if components create exchange the wrong way.


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

Branch: refs/heads/camel-2.16.x
Commit: 70098b04e3eacb70dbb4d6f3da692c61fb5483bf
Parents: 3a56fa8
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sat Oct 17 10:41:10 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Oct 18 13:09:46 2015 +0200

----------------------------------------------------------------------
 .../camel/impl/DefaultRuntimeEndpointRegistry.java      | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/70098b04/camel-core/src/main/java/org/apache/camel/impl/DefaultRuntimeEndpointRegistry.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultRuntimeEndpointRegistry.java
b/camel-core/src/main/java/org/apache/camel/impl/DefaultRuntimeEndpointRegistry.java
index d866fea..9fd4c31 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultRuntimeEndpointRegistry.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultRuntimeEndpointRegistry.java
@@ -241,11 +241,13 @@ public class DefaultRuntimeEndpointRegistry extends EventNotifierSupport
impleme
             // we only capture details in extended mode
             ExchangeCreatedEvent ece = (ExchangeCreatedEvent) event;
             Endpoint endpoint = ece.getExchange().getFromEndpoint();
-            String routeId = ece.getExchange().getFromRouteId();
-            String uri = endpoint.getEndpointUri();
-            String key = asUtilizationKey(routeId, uri);
-            if (key != null) {
-                inputUtilization.onHit(key);
+            if (endpoint != null) {
+                String routeId = ece.getExchange().getFromRouteId();
+                String uri = endpoint.getEndpointUri();
+                String key = asUtilizationKey(routeId, uri);
+                if (key != null) {
+                    inputUtilization.onHit(key);
+                }
             }
         } else if (event instanceof ExchangeSendingEvent) {
             ExchangeSendingEvent ese = (ExchangeSendingEvent) event;


Mime
View raw message