mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-05 18:58:02 -05:00
Avoid out of bound exception getting attachment by index
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@107 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
67e4c1b3b8
commit
e133b81599
@ -1388,7 +1388,9 @@ public class ExchangeSession {
|
||||
|
||||
// try to get attachment by index, only if no name found
|
||||
// or attachment renamed to winmail.dat by Exchange
|
||||
if (attachment == null && (partHeader.name == null || "winmail.dat".equals(partHeader.name))) {
|
||||
if (attachment == null && (partHeader.name == null || "winmail.dat".equals(partHeader.name))
|
||||
// avoid out of bounds exception
|
||||
&& attachmentIndex >= 0 && attachmentIndex < attachments.size()) {
|
||||
attachment = attachments.get(attachmentIndex);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user