Commit df18e97c authored by Mickaël Guessant's avatar Mickaël Guessant

EWS: avoid NullPointerException in fixAttendees

git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@2306 3d1905a2-6b24-0410-a738-b14d5a86fcbd
parent 55b42e26
...@@ -1868,20 +1868,22 @@ public class EwsExchangeSession extends ExchangeSession { ...@@ -1868,20 +1868,22 @@ public class EwsExchangeSession extends ExchangeSession {
} }
protected void fixAttendees(GetItemMethod getItemMethod, VObject vEvent) throws EWSException { protected void fixAttendees(GetItemMethod getItemMethod, VObject vEvent) throws EWSException {
List<EWSMethod.Attendee> attendees = getItemMethod.getResponseItem().getAttendees(); if (getItemMethod.getResponseItem() != null) {
if (attendees != null) { List<EWSMethod.Attendee> attendees = getItemMethod.getResponseItem().getAttendees();
for (EWSMethod.Attendee attendee : attendees) { if (attendees != null) {
VProperty attendeeProperty = new VProperty("ATTENDEE", "mailto:" + attendee.email); for (EWSMethod.Attendee attendee : attendees) {
attendeeProperty.addParam("CN", attendee.name); VProperty attendeeProperty = new VProperty("ATTENDEE", "mailto:" + attendee.email);
String myResponseType = getItemMethod.getResponseItem().get(Field.get("myresponsetype").getResponseName()); attendeeProperty.addParam("CN", attendee.name);
if (email.equalsIgnoreCase(attendee.email) && myResponseType != null) { String myResponseType = getItemMethod.getResponseItem().get(Field.get("myresponsetype").getResponseName());
attendeeProperty.addParam("PARTSTAT", EWSMethod.responseTypeToPartstat(myResponseType)); if (email.equalsIgnoreCase(attendee.email) && myResponseType != null) {
} else { attendeeProperty.addParam("PARTSTAT", EWSMethod.responseTypeToPartstat(myResponseType));
attendeeProperty.addParam("PARTSTAT", attendee.partstat); } else {
attendeeProperty.addParam("PARTSTAT", attendee.partstat);
}
//attendeeProperty.addParam("RSVP", "TRUE");
attendeeProperty.addParam("ROLE", attendee.role);
vEvent.addProperty(attendeeProperty);
} }
//attendeeProperty.addParam("RSVP", "TRUE");
attendeeProperty.addParam("ROLE", attendee.role);
vEvent.addProperty(attendeeProperty);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment