camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: CAMEL-11648: skip metadata when it is null
Date Tue, 08 Aug 2017 02:28:44 GMT
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 <gymisi@gmail.com>
Authored: Mon Aug 7 22:02:49 2017 +0200
Committer: mgyongyosi <gymisi@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());


Mime
View raw message