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 2015/10/17 10:38:59 UTC
[6/6] camel git commit: Fixed potential NPE if components create
exchange the wrong way.
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/20200df3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/20200df3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/20200df3
Branch: refs/heads/master
Commit: 20200df3630a4393768df3b1f526aef04692f843
Parents: 2a90c3e
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Oct 17 10:41:10 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Oct 17 10:41:20 2015 +0200
----------------------------------------------------------------------
.../camel/impl/DefaultRuntimeEndpointRegistry.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/20200df3/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;