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:44 UTC

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

Repository: camel
Updated Branches:
  refs/heads/camel-2.19.x 507916f52 -> b99ee3fdf
  refs/heads/master a3dfb07c4 -> 71cc69d73


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/71cc69d7
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/71cc69d7
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/71cc69d7

Branch: refs/heads/master
Commit: 71cc69d73af2ddcd87d48dbf31b85b119afee1af
Parents: a3dfb07
Author: mgyongyosi <gy...@gmail.com>
Authored: Mon Aug 7 22:02:49 2017 +0200
Committer: mgyongyosi <gy...@gmail.com>
Committed: Mon Aug 7 22:10:53 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/71cc69d7/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());


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

Posted by da...@apache.org.
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());