Catch possible NPE in IMAP sync.
I don't know the root cause of the null pointer (possibly a broken connection earlier in the sync) but we shouldn't be crashing here. Fixes http://b/2135743
This commit is contained in:
parent
0f7542e714
commit
0d4681cd66
@ -679,8 +679,11 @@ public class ImapStore extends Store {
|
|||||||
for (Object o : fp) {
|
for (Object o : fp) {
|
||||||
if (o instanceof Part) {
|
if (o instanceof Part) {
|
||||||
Part part = (Part) o;
|
Part part = (Part) o;
|
||||||
String partId = part.getHeader(MimeHeader.HEADER_ANDROID_ATTACHMENT_STORE_DATA)[0];
|
String[] partIds =
|
||||||
fetchFields.add("BODY.PEEK[" + partId + "]");
|
part.getHeader(MimeHeader.HEADER_ANDROID_ATTACHMENT_STORE_DATA);
|
||||||
|
if (partIds != null) {
|
||||||
|
fetchFields.add("BODY.PEEK[" + partIds[0] + "]");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user