1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-24 08:38:51 -05:00

Fix for index out of bounds exception (regression) from r330

This commit is contained in:
Matthew Brace 2009-01-31 22:09:16 +00:00
parent 7ac3fe2ebe
commit f184350aec
2 changed files with 12 additions and 6 deletions

View File

@ -233,15 +233,18 @@ public class AccountSetupIncoming extends Activity implements OnClickListener {
for (int i = 0, count = pathParts.length; i < count; i++) {
if (i == 0) {
if (pathParts[0] != null) {
if (pathParts[0] != null &&
pathParts[0].length() > 1) {
mWebdavPathPrefixView.setText(pathParts[0].substring(1));
}
} else if (i == 1) {
if (pathParts[1] != null) {
if (pathParts[1] != null &&
pathParts[1].length() > 1) {
mWebdavAuthPathView.setText(pathParts[1]);
}
} else if (i == 2) {
if (pathParts[2] != null ) {
if (pathParts[2] != null &&
pathParts[2].length() > 1) {
mWebdavMailboxPathView.setText(pathParts[2]);
}
}

View File

@ -140,7 +140,8 @@ public class WebDavStore extends Store {
for (int i = 0, count = pathParts.length; i < count; i++) {
if (i == 0) {
if (pathParts[0] != null) {
if (pathParts[0] != null &&
pathParts[0].length() > 1) {
if (!pathParts[0].substring(1).equals("")) {
mPath = pathParts[0].substring(1);
} else {
@ -150,11 +151,13 @@ public class WebDavStore extends Store {
mPath = "";
}
} else if (i == 1) {
if (pathParts[1] != null) {
if (pathParts[1] != null &&
pathParts[1].length() > 1) {
mAuthPath = "/" + pathParts[1];
}
} else if (i == 2) {
if (pathParts[2] != null) {
if (pathParts[2] != null &&
pathParts[2].length() > 1) {
mMailboxPath = "/" + pathParts[2];
if (mPath == null ||
mPath.equals("")) {