camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/4] git commit: Fixed potential NPE
Date Sat, 14 Sep 2013 10:58:56 GMT
Fixed potential NPE


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

Branch: refs/heads/camel-2.12.x
Commit: 56d61727699534fb6387cbfb0252432ab992e7c5
Parents: d4531f8
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sat Sep 14 12:57:13 2013 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sat Sep 14 12:57:39 2013 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/processor/RedeliveryErrorHandler.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/56d61727/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
b/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
index 46d4f60..b1a5030 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
@@ -910,8 +910,9 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport
impleme
             // and put failure endpoint back as well
             exchange.setProperty(Exchange.FAILURE_ENDPOINT, exchange.getProperty(Exchange.TO_ENDPOINT));
             // and store the route id so we know in which route we failed
-            if (exchange.getUnitOfWork().getRouteContext() != null) {
-                exchange.setProperty(Exchange.FAILURE_ROUTE_ID, exchange.getUnitOfWork().getRouteContext().getRoute().getId());
+            UnitOfWork uow = exchange.getUnitOfWork();
+            if (uow != null && uow.getRouteContext() != null) {
+                exchange.setProperty(Exchange.FAILURE_ROUTE_ID, uow.getRouteContext().getRoute().getId());
             }
         }
     }


Mime
View raw message