1
0
mirror of https://github.com/etesync/android synced 2025-01-11 00:01:12 +00:00

Allow null values for IS_ORGANIZER

This commit is contained in:
Ricki Hirner 2017-04-18 23:53:25 +02:00 committed by Tom Hacohen
parent e82d8affe8
commit 17d90a4569

View File

@ -103,9 +103,10 @@ public class LocalEvent extends AndroidEvent implements LocalResource {
event.uid = values.getAsString(COLUMN_UID);
event.sequence = values.getAsInteger(COLUMN_SEQUENCE);
if (Build.VERSION.SDK_INT >= 17)
weAreOrganizer = values.getAsInteger(Events.IS_ORGANIZER) != 0;
else {
if (Build.VERSION.SDK_INT >= 17) {
Integer isOrganizer = values.getAsInteger(Events.IS_ORGANIZER);
weAreOrganizer = isOrganizer != null && isOrganizer != 0;
} else {
String organizer = values.getAsString(Events.ORGANIZER);
weAreOrganizer = organizer == null || organizer.equals(calendar.account.name);
}