From bd4b7d36645a6ea5548100ada1a1b928c46a9b96 Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Thu, 20 Mar 2014 10:56:02 -0400 Subject: [PATCH] Issue 6280 -- SMTP Setup: ArrayIndexOutOfBoundsException: length=0; index=0 When the outgoing server settings don't require authentication, userInfoParts.length == 0. --- src/com/fsck/k9/mail/transport/SmtpTransport.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/fsck/k9/mail/transport/SmtpTransport.java b/src/com/fsck/k9/mail/transport/SmtpTransport.java index 286253b5c..2636a8710 100644 --- a/src/com/fsck/k9/mail/transport/SmtpTransport.java +++ b/src/com/fsck/k9/mail/transport/SmtpTransport.java @@ -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"); }