camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: Fixed potential NPE
Date Wed, 04 Mar 2015 10:08:33 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/a8fd547f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a8fd547f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a8fd547f

Branch: refs/heads/master
Commit: a8fd547fbc63429831be89b5f5566334bd9b4358
Parents: 15174ce
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Mar 4 11:08:31 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Mar 4 11:09:49 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/camel/impl/ScheduledPollConsumer.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a8fd547f/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java b/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java
index beac5bf..5f25a4f 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java
@@ -458,8 +458,10 @@ public abstract class ScheduledPollConsumer extends DefaultConsumer implements
R
 
     @Override
     protected void doStop() throws Exception {
-        scheduler.unscheduleTask();
-        ServiceHelper.stopAndShutdownServices(scheduler);
+        if (scheduler != null) {
+            scheduler.unscheduleTask();
+            ServiceHelper.stopAndShutdownServices(scheduler);
+        }
 
         // clear counters
         backoffCounter = 0;


Mime
View raw message