From 71493a5a284038c76b8b77e3b689c56e32bc9411 Mon Sep 17 00:00:00 2001 From: mguessan Date: Wed, 16 Mar 2011 10:55:09 +0000 Subject: [PATCH] EWS: fix NullPointerException in item getContent git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1641 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ews/EwsExchangeSession.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/java/davmail/exchange/ews/EwsExchangeSession.java b/src/java/davmail/exchange/ews/EwsExchangeSession.java index e2fc9bc2..557183b9 100644 --- a/src/java/davmail/exchange/ews/EwsExchangeSession.java +++ b/src/java/davmail/exchange/ews/EwsExchangeSession.java @@ -460,7 +460,11 @@ public class EwsExchangeSession extends ExchangeSession { protected byte[] getContent(ItemId itemId) throws IOException { GetItemMethod getItemMethod = new GetItemMethod(BaseShape.ID_ONLY, itemId, true); executeMethod(getItemMethod); - return getItemMethod.getMimeContent(); + byte[] mimeContent = getItemMethod.getMimeContent(); + if (mimeContent == null) { + throw new IOException("GetItem returned null MimeContent"); + } + return mimeContent; } protected Message buildMessage(EWSMethod.Item response) throws DavMailException {