camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [08/10] camel git commit: Update CMISSessionFacade.java
Date Thu, 01 Jun 2017 07:13:22 GMT
Update CMISSessionFacade.java

Fixing possible null-pointer of document variable.

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

Branch: refs/heads/camel-2.18.x
Commit: 8c6ae74fdcc7d411e60a5e4d4d586ce18ded827d
Parents: 94d4881
Author: Tomáš Burian <tomas.burian@lundegaard.eu>
Authored: Wed May 31 17:03:22 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Jun 1 09:12:25 2017 +0200

----------------------------------------------------------------------
 .../org/apache/camel/component/cmis/CMISSessionFacade.java   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8c6ae74f/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java
----------------------------------------------------------------------
diff --git a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java
b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java
index d143d7c..0af07d2 100644
--- a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java
+++ b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java
@@ -182,9 +182,11 @@ public class CMISSessionFacade {
 
     public InputStream getContentStreamFor(QueryResult item) {
         Document document = getDocument(item);
-        ContentStream contentStream = document.getContentStream();
-        if (document != null && contentStream != null) {
-            return contentStream.getStream();
+        if(document != null) {
+            ContentStream contentStream = document.getContentStream();
+            if (contentStream != null) {
+                return contentStream.getStream();
+            }
         }
         return null;
     }


Mime
View raw message