Issue 6280 -- SMTP Setup: ArrayIndexOutOfBoundsException: length=0; index=0
When the outgoing server settings don't require authentication, userInfoParts.length == 0.
This commit is contained in:
parent
95f62785fc
commit
bd4b7d3664
1 changed files with 3 additions and 1 deletions
|
@ -95,7 +95,9 @@ public class SmtpTransport extends Transport {
|
|||
if (smtpUri.getUserInfo() != null) {
|
||||
try {
|
||||
String[] userInfoParts = smtpUri.getUserInfo().split(":");
|
||||
username = URLDecoder.decode(userInfoParts[0], "UTF-8");
|
||||
if (userInfoParts.length > 0) {
|
||||
username = URLDecoder.decode(userInfoParts[0], "UTF-8");
|
||||
}
|
||||
if (userInfoParts.length > 1) {
|
||||
password = URLDecoder.decode(userInfoParts[1], "UTF-8");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue