1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

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:
Joe Steele 2014-03-20 10:56:02 -04:00
parent 95f62785fc
commit bd4b7d3664

View File

@ -95,7 +95,9 @@ public class SmtpTransport extends Transport {
if (smtpUri.getUserInfo() != null) { if (smtpUri.getUserInfo() != null) {
try { try {
String[] userInfoParts = smtpUri.getUserInfo().split(":"); 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) { if (userInfoParts.length > 1) {
password = URLDecoder.decode(userInfoParts[1], "UTF-8"); password = URLDecoder.decode(userInfoParts[1], "UTF-8");
} }