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:19 UTC
[2/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/82e03195
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/82e03195
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/82e03195
Branch: refs/heads/camel-2.11.x
Commit: 82e03195e5ce68f9cad6c8238bb087dc9f6590fe
Parents: e860595
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:38:45 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/82e03195/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 0ba6a7f..d0ef269 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
@@ -280,7 +280,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()};
+ }
}
});