Updated Branches:
  refs/heads/camel-2.10.x 6eb5ff0f3 -> fbc3edbde
  refs/heads/camel-2.11.x e86059512 -> 82e03195e
  refs/heads/master 1914ba9be -> 8e0cf8cca


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

Branch: refs/heads/master
Commit: 8e0cf8cca5e9366cda4fc888d965b6a9597033e7
Parents: 1914ba9
Author: Claus Ibsen <davscl...@apache.org>
Authored: Wed Jul 10 18:38:27 2013 +0200
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Wed Jul 10 18:38:27 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/8e0cf8cc/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 f3e4c39..85a7d9e 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
@@ -301,7 +301,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()};
+                }
             }
 
         });

Reply via email to