1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 11:12:22 -05:00

IMAP: fix nullpointerException in header fetch

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1545 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-11-17 23:17:58 +00:00
parent e16e2bd530
commit 7bab6a0a66

View File

@ -796,12 +796,16 @@ public class ImapConnection extends AbstractConnection {
} }
protected String[] getRequestedHeaders(String partIndexString) { protected String[] getRequestedHeaders(String partIndexString) {
int startIndex = partIndexString.indexOf('('); if (partIndexString == null) {
int endIndex = partIndexString.indexOf(')');
if (startIndex >= 0 && endIndex >= 0) {
return partIndexString.substring(startIndex + 1, endIndex - 1).split(" ");
} else {
return null; return null;
} else {
int startIndex = partIndexString.indexOf('(');
int endIndex = partIndexString.indexOf(')');
if (startIndex >= 0 && endIndex >= 0) {
return partIndexString.substring(startIndex + 1, endIndex - 1).split(" ");
} else {
return null;
}
} }
} }