Fix NPE in exception parsing
Bug: 2516099
Change-Id: I4d64c306f2c0421f0145dab11f10bfb174e46c0a
diff --git a/src/com/android/exchange/adapter/CalendarSyncAdapter.java b/src/com/android/exchange/adapter/CalendarSyncAdapter.java
index 49f9ca5..8085eeb 100644
--- a/src/com/android/exchange/adapter/CalendarSyncAdapter.java
+++ b/src/com/android/exchange/adapter/CalendarSyncAdapter.java
@@ -248,7 +248,7 @@
long endTime = -1;
// Keep track of the attendees; exceptions will need them
- ArrayList<ContentValues> attendeeValues = null;
+ ArrayList<ContentValues> attendeeValues = new ArrayList<ContentValues>();
int reminderMins = -1;
while (nextTag(Tags.SYNC_APPLICATION_DATA) != END) {
@@ -603,8 +603,10 @@
int exceptionStart = ops.mCount;
ops.newException(cv);
// Also add the attendees, because they need to be copied over from the parent event
- for (ContentValues attValues: attendeeValues) {
- ops.newAttendee(attValues, exceptionStart);
+ if (attendeeValues != null) {
+ for (ContentValues attValues: attendeeValues) {
+ ops.newAttendee(attValues, exceptionStart);
+ }
}
// And add the parent's reminder value
if (reminderMins > 0) {