mirror of
https://github.com/etesync/android
synced 2025-01-11 08:10:58 +00:00
Import fragment: move the null assertions around a bit
Better this way. Easier to know what's going on.
This commit is contained in:
parent
69bf028481
commit
b6453718f4
@ -260,12 +260,12 @@ class ImportFragment : DialogFragment() {
|
|||||||
|
|
||||||
finishParsingFile(contacts.size)
|
finishParsingFile(contacts.size)
|
||||||
|
|
||||||
val provider = context!!.contentResolver.acquireContentProviderClient(ContactsContract.RawContacts.CONTENT_URI)
|
val provider = context!!.contentResolver.acquireContentProviderClient(ContactsContract.RawContacts.CONTENT_URI)!!
|
||||||
val localAddressBook = LocalAddressBook.findByUid(context!!, provider!!, account, info.uid!!)
|
val localAddressBook = LocalAddressBook.findByUid(context!!, provider, account, info.uid!!)!!
|
||||||
|
|
||||||
for (contact in contacts.filter { contact -> !contact.group }) {
|
for (contact in contacts.filter { contact -> !contact.group }) {
|
||||||
try {
|
try {
|
||||||
val localContact = LocalContact(localAddressBook!!, contact, null, null)
|
val localContact = LocalContact(localAddressBook, contact, null, null)
|
||||||
localContact.createAsDirty()
|
localContact.createAsDirty()
|
||||||
// If uid is null, so be it. We won't be able to process the group later.
|
// If uid is null, so be it. We won't be able to process the group later.
|
||||||
oldUidToNewId[contact.uid] = localContact.id!!
|
oldUidToNewId[contact.uid] = localContact.id!!
|
||||||
@ -287,7 +287,7 @@ class ImportFragment : DialogFragment() {
|
|||||||
|
|
||||||
for (contact in contacts.filter { contact -> contact.group }) {
|
for (contact in contacts.filter { contact -> contact.group }) {
|
||||||
try {
|
try {
|
||||||
val localGroup = LocalGroup(localAddressBook!!, contact, null, null)
|
val localGroup = LocalGroup(localAddressBook, contact, null, null)
|
||||||
val memberIds = contact.members.mapNotNull { memberUid ->
|
val memberIds = contact.members.mapNotNull { memberUid ->
|
||||||
oldUidToNewId[memberUid]
|
oldUidToNewId[memberUid]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user