Skip to content

Commit a0cc5c5

Browse files
committed
fix(widget): don't crash when restoring the unread widget configuration
1 parent 859f684 commit a0cc5c5

3 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎core/android/account/src/main/kotlin/net/thunderbird/core/android/account/LegacyAccount.kt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ data class LegacyAccount(
164164
return findIdentity(address) != null
165165
}
166166

167-
@Synchronized
168167
fun findIdentity(address: Address): Identity? {
169168
// Prefer to match by email and name.
170169
// Fall back to email only if no identity's name matches (e.g. a renamed identity).
@@ -176,7 +175,6 @@ data class LegacyAccount(
176175
}
177176
}
178177

179-
@Synchronized
180178
fun getIdentity(index: Int): Identity {
181179
if (index !in identities.indices) throw NoSuchElementException("Identity with index $index not found")
182180

‎feature/widget/unread/src/main/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetConfigurationFragment.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class UnreadWidgetConfigurationFragment : PreferenceFragmentCompat() {
121121

122122
override fun onSaveInstanceState(outState: Bundle) {
123123
super.onSaveInstanceState(outState)
124-
outState.putString(STATE_SELECTED_ACCOUNT_UUID, selectedAccountId.toString())
124+
selectedAccountId?.let { outState.putString(STATE_SELECTED_ACCOUNT_UUID, it.toString()) }
125125
outState.putLongIfPresent(STATE_SELECTED_FOLDER_ID, selectedFolderId)
126126
outState.putString(STATE_SELECTED_FOLDER_DISPLAY_NAME, selectedFolderDisplayName)
127127
}

‎legacy/core/src/main/java/com/fsck/k9/search/LocalSearchExtensions.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fun LocalMessageSearch.getLegacyAccounts(accountManager: LegacyAccountManager):
3131
accounts
3232
} else {
3333
val searchAccountIds = accountIds.toSet()
34-
accounts.filter { it.id in searchAccountIds || it.id in searchAccountIds }
34+
accounts.filter { it.id in searchAccountIds }
3535
}
3636
}
3737

0 commit comments

Comments
 (0)