Author: imario
Date: Thu Oct  5 22:37:21 2006
New Revision: 453502

URL: http://svn.apache.org/viewvc?view=rev&rev=453502
Log:
VFS-93: fixed NPE with urls without password

Modified:
    
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java

Modified: 
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java?view=diff&rev=453502&r1=453501&r2=453502
==============================================================================
--- 
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java
 (original)
+++ 
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java
 Thu Oct  5 22:37:21 2006
@@ -131,14 +131,17 @@
             session = jsch.getSession(new String(username),
                     hostname,
                     port);
-            session.setPassword(new String(password));
+            if (password != null)
+            {
+                session.setPassword(new String(password));
+            }
 
             Integer timeout = 
SftpFileSystemConfigBuilder.getInstance().getTimeout(fileSystemOptions);
             if (timeout != null)
             {
                session.setTimeout(timeout.intValue());
             }
-            
+
             UserInfo userInfo = 
SftpFileSystemConfigBuilder.getInstance().getUserInfo(fileSystemOptions);
             if (userInfo != null)
             {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to