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 2013/07/10 18:39:20 UTC

[3/3] git commit: CAMEL-6514: Fixed NPE in sftp if no password given. Thanks to Joerg Kessler for reporting.

CAMEL-6514: Fixed NPE in sftp if no password given. Thanks to Joerg Kessler for reporting.


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

Branch: refs/heads/camel-2.10.x
Commit: fbc3edbde3af8859a03ef4c7ba55715ae48b18dd
Parents: 6eb5ff0
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jul 10 18:38:27 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jul 10 18:39:02 2013 +0200

----------------------------------------------------------------------
 .../apache/camel/component/file/remote/SftpOperations.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/fbc3edbd/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
----------------------------------------------------------------------
diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
index 4de94e8..61cf8dd 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
@@ -227,7 +227,12 @@ public class SftpOperations implements RemoteFileOperations<ChannelSftp.LsEntry>
 
             public String[] promptKeyboardInteractive(String destination, String name,
                                                       String instruction, String[] prompt, boolean[] echo) {
-                return new String[]{configuration.getPassword()};
+                // must return an empty array if password is null
+                if (configuration.getPassword() == null) {
+                    return new String[0];
+                } else {
+                    return new String[]{configuration.getPassword()};
+                }
             }
 
         });