diff options
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java index 0a50fe2d29..b3a55a581b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java @@ -170,8 +170,14 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport { return loadPropertiesFile(propsFile); Properties props = new Properties(); - props.setProperty("accesskey", uri.getUser()); //$NON-NLS-1$ - props.setProperty("secretkey", uri.getPass()); //$NON-NLS-1$ + String user = uri.getUser(); + String pass = uri.getPass(); + if (user != null && pass != null) { + props.setProperty("accesskey", user); //$NON-NLS-1$ + props.setProperty("secretkey", pass); //$NON-NLS-1$ + } else + throw new NotSupportedException(MessageFormat.format( + JGitText.get().cannotReadFile, propsFile)); return props; } |