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 2017/08/08 02:28:45 UTC

[2/2] camel git commit: CAMEL-11648: skip metadata when it is null

CAMEL-11648: skip metadata when it is null


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

Branch: refs/heads/camel-2.19.x
Commit: b99ee3fdfb94f18971ebf781ee0c99b6fcbe85bb
Parents: 507916f
Author: mgyongyosi <gy...@gmail.com>
Authored: Mon Aug 7 22:02:49 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Aug 8 04:28:08 2017 +0200

----------------------------------------------------------------------
 .../apache/camel/component/mongodb/gridfs/GridFsProducer.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b99ee3fd/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/mongodb/gridfs/GridFsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/mongodb/gridfs/GridFsProducer.java b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/mongodb/gridfs/GridFsProducer.java
index 8459356..346aa54 100644
--- a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/mongodb/gridfs/GridFsProducer.java
+++ b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/mongodb/gridfs/GridFsProducer.java
@@ -59,7 +59,9 @@ public class GridFsProducer extends DefaultProducer {
             }
             String metaData = exchange.getIn().getHeader(GridFsEndpoint.GRIDFS_METADATA, String.class);
             DBObject dbObject = (DBObject) JSON.parse(metaData);
-            gfsFile.setMetaData(dbObject);
+            if (dbObject != null) {
+                gfsFile.setMetaData(dbObject);
+            }
             gfsFile.save();
             //add headers with the id and file name produced by the driver.
             exchange.getIn().setHeader(Exchange.FILE_NAME_PRODUCED, gfsFile.getFilename());