Guard log statement against null obj

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

Branch: refs/heads/camel-2.12.x
Commit: d278c0159e314c45b68e4f49095b91167eedd2b1
Parents: b855e8a
Author: Jonathan Anstey <jans...@gmail.com>
Authored: Fri Jan 31 12:22:49 2014 -0330
Committer: Jonathan Anstey <jans...@gmail.com>
Committed: Fri Jan 31 12:36:25 2014 -0330

----------------------------------------------------------------------
 .../java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d278c015/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
----------------------------------------------------------------------
diff --git 
a/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
 
b/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
index 29b3bcf..8c2bb9a 100755
--- 
a/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
+++ 
b/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
@@ -258,7 +258,8 @@ public class BindyCsvFactory extends BindyAbstractFactory 
implements BindyFactor
             if (model.containsKey(clazz.getName())) {
 
                 Object obj = model.get(clazz.getName());
-                if (LOG.isDebugEnabled()) {
+                
+                if (obj != null && LOG.isDebugEnabled()) {
                     LOG.debug("Model object: {}, class: {}", obj, 
obj.getClass().getName());
                 }
                 if (obj != null) {

Reply via email to