1
0
mirror of https://github.com/etesync/android synced 2024-11-22 07:58:09 +00:00

Fix access to uninitialized properties in account update service.

This commit is contained in:
Tom Hacohen 2019-04-16 13:18:28 +01:00
parent 26063ce9f5
commit f629d23c38

View File

@ -88,14 +88,14 @@ class AccountUpdateService : Service() {
val accountNames = LinkedList<String>() val accountNames = LinkedList<String>()
val am = AccountManager.get(this) val am = AccountManager.get(this)
for (account in am.getAccountsByType(App.accountType)) { for (account in am.getAccountsByType(getString(R.string.account_type))) {
accountNames.add(account.name) accountNames.add(account.name)
} }
val data = (application as App).data val data = (application as App).data
// delete orphaned address book accounts // delete orphaned address book accounts
for (addrBookAccount in am.getAccountsByType(App.addressBookAccountType)) { for (addrBookAccount in am.getAccountsByType(getString(R.string.account_type_address_book))) {
val addressBook = LocalAddressBook(this, addrBookAccount, null) val addressBook = LocalAddressBook(this, addrBookAccount, null)
try { try {
if (!accountNames.contains(addressBook.mainAccount.name)) if (!accountNames.contains(addressBook.mainAccount.name))