camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [1/3] camel git commit: added null check before trying to call containsKey (prevent NPE)
Date Tue, 11 Oct 2016 08:06:42 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.17.x 091855d68 -> 9fc87f2c4


added null check before trying to call containsKey (prevent NPE)


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

Branch: refs/heads/camel-2.17.x
Commit: 304178c520b672a309863d90c296b5cdae64043a
Parents: 9f1574b
Author: Michael Lück <michael.lueck@hm-ag.de>
Authored: Wed Oct 5 15:22:51 2016 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Tue Oct 11 10:01:21 2016 +0200

----------------------------------------------------------------------
 .../aggregate/hazelcast/HazelcastAggregationRepository.java       | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/304178c5/components/camel-hazelcast/src/main/java/org/apache/camel/processor/aggregate/hazelcast/HazelcastAggregationRepository.java
----------------------------------------------------------------------
diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/processor/aggregate/hazelcast/HazelcastAggregationRepository.java
b/components/camel-hazelcast/src/main/java/org/apache/camel/processor/aggregate/hazelcast/HazelcastAggregationRepository.java
index 33185f0..9dd0c17 100644
--- a/components/camel-hazelcast/src/main/java/org/apache/camel/processor/aggregate/hazelcast/HazelcastAggregationRepository.java
+++ b/components/camel-hazelcast/src/main/java/org/apache/camel/processor/aggregate/hazelcast/HazelcastAggregationRepository.java
@@ -296,7 +296,10 @@ public class HazelcastAggregationRepository extends ServiceSupport
      * @param key Object - key in question
      */
     public boolean containsKey(Object key){
+      if(cache != null)
         return cache.containsKey(key);
+      else
+        return false;
     }
     
     public boolean isAllowSerializedHeaders() {


Mime
View raw message