mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-07 11:48:02 -05:00
Dav: fix nullpointer in DavExchangeSession
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1186 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
641dcaeeb1
commit
4131c0f505
@ -1432,25 +1432,26 @@ public class DavExchangeSession extends ExchangeSession {
|
|||||||
String messageUrl = URIUtil.encodePathQuery(getFolderPath(folderPath) + '/' + messageName + ".EML");
|
String messageUrl = URIUtil.encodePathQuery(getFolderPath(folderPath) + '/' + messageName + ".EML");
|
||||||
PropPatchMethod patchMethod;
|
PropPatchMethod patchMethod;
|
||||||
List<DavConstants> davProperties = buildProperties(properties);
|
List<DavConstants> davProperties = buildProperties(properties);
|
||||||
if (!properties.containsKey("read")) {
|
if (properties != null) {
|
||||||
// force unread
|
if (!properties.containsKey("read")) {
|
||||||
davProperties.add(Field.createDavProperty("read", "0"));
|
// force unread
|
||||||
}
|
davProperties.add(Field.createDavProperty("read", "0"));
|
||||||
// create the message first as draft
|
}
|
||||||
if (properties.containsKey("draft")) {
|
// create the message first as draft
|
||||||
patchMethod = new PropPatchMethod(messageUrl, davProperties);
|
if (properties.containsKey("draft")) {
|
||||||
try {
|
patchMethod = new PropPatchMethod(messageUrl, davProperties);
|
||||||
// update message with blind carbon copy and other flags
|
try {
|
||||||
int statusCode = httpClient.executeMethod(patchMethod);
|
// update message with blind carbon copy and other flags
|
||||||
if (statusCode != HttpStatus.SC_MULTI_STATUS) {
|
int statusCode = httpClient.executeMethod(patchMethod);
|
||||||
throw new DavMailException("EXCEPTION_UNABLE_TO_CREATE_MESSAGE", messageUrl, statusCode, ' ', patchMethod.getStatusLine());
|
if (statusCode != HttpStatus.SC_MULTI_STATUS) {
|
||||||
}
|
throw new DavMailException("EXCEPTION_UNABLE_TO_CREATE_MESSAGE", messageUrl, statusCode, ' ', patchMethod.getStatusLine());
|
||||||
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
patchMethod.releaseConnection();
|
patchMethod.releaseConnection();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PutMethod putmethod = new PutMethod(messageUrl);
|
PutMethod putmethod = new PutMethod(messageUrl);
|
||||||
putmethod.setRequestHeader("Translate", "f");
|
putmethod.setRequestHeader("Translate", "f");
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user