Browse Source

EWS: avoid NullPointerException in fixAttendees

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2306 3d1905a2-6b24-0410-a738-b14d5a86fcbd
master
mguessan 9 years ago
parent
commit
d071c59e4a
  1. 28
      src/java/davmail/exchange/ews/EwsExchangeSession.java

28
src/java/davmail/exchange/ews/EwsExchangeSession.java

@ -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 {
List<EWSMethod.Attendee> attendees = getItemMethod.getResponseItem().getAttendees();
if (attendees != null) {
for (EWSMethod.Attendee attendee : attendees) {
VProperty attendeeProperty = new VProperty("ATTENDEE", "mailto:" + attendee.email);
attendeeProperty.addParam("CN", attendee.name);
String myResponseType = getItemMethod.getResponseItem().get(Field.get("myresponsetype").getResponseName());
if (email.equalsIgnoreCase(attendee.email) && myResponseType != null) {
attendeeProperty.addParam("PARTSTAT", EWSMethod.responseTypeToPartstat(myResponseType));
} else {
attendeeProperty.addParam("PARTSTAT", attendee.partstat);
if (getItemMethod.getResponseItem() != null) {
List<EWSMethod.Attendee> attendees = getItemMethod.getResponseItem().getAttendees();
if (attendees != null) {
for (EWSMethod.Attendee attendee : attendees) {
VProperty attendeeProperty = new VProperty("ATTENDEE", "mailto:" + attendee.email);
attendeeProperty.addParam("CN", attendee.name);
String myResponseType = getItemMethod.getResponseItem().get(Field.get("myresponsetype").getResponseName());
if (email.equalsIgnoreCase(attendee.email) && myResponseType != null) {
attendeeProperty.addParam("PARTSTAT", EWSMethod.responseTypeToPartstat(myResponseType));
} 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);
}
}
}

Loading…
Cancel
Save