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 2014-07-28 21:58:08 +00:00
parent 448c72895a
commit d071c59e4a
1 changed files with 15 additions and 13 deletions

View File

@ -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);
}
}
}