diff --git a/app/src/main/java/com/etesync/syncadapter/resource/LocalGroup.kt b/app/src/main/java/com/etesync/syncadapter/resource/LocalGroup.kt index 99e6fb18..2282e7de 100644 --- a/app/src/main/java/com/etesync/syncadapter/resource/LocalGroup.kt +++ b/app/src/main/java/com/etesync/syncadapter/resource/LocalGroup.kt @@ -63,8 +63,9 @@ class LocalGroup : AndroidGroup, LocalAddress { // insert memberships val membersIds = members.map {uid -> Constants.log.fine("Assigning member: $uid") - (addressBook.findByUid(uid) as LocalContact).id!! - } + val contact = addressBook.findByUid(uid) as LocalContact? + if (contact != null) contact.id else null + }.filterNotNull() val group = addressBook.findGroupById(id) group.setMembers(batch, membersIds)